for (Iterator i = ((NodeSet) results).iterator(); i.hasNext();) { p = (NodeProxy) i.next(); if ((documents = (TreeMap) collections.get(p.doc.getCollection().getName())) == null) { documents = new TreeMap(); collections.put(p.doc.getCollection().getName(), documents);
for (SequenceIterator i = results.iterate(); i.hasNext(); ) { Item item = i.nextItem(); if(Type.subTypeOf(item.getType(), Type.NODE)) { NodeValue node = (NodeValue)item; if(node.getImplementationType() == NodeValue.PERSISTENT_NODE) { NodeProxy p = (NodeProxy)node; if ((documents = (TreeMap) collections.get(p.doc.getCollection().getName())) == null) { documents = new TreeMap(); collections.put(p.doc.getCollection().getName(), documents); } if ((hits = (Integer) documents.get(p.doc.getFileName())) == null) documents.put(p.doc.getFileName(), new Integer(1)); else documents.put(p.doc.getFileName(), new Integer(hits.intValue() + 1)); }
	private TreeMap scanResults(NodeList results) {		TreeMap collections = new TreeMap();		TreeMap documents;		NodeProxy p;		Integer hits;		for (Iterator i = ((NodeSet) results).iterator(); i.hasNext();) {			p = (NodeProxy) i.next();			if ((documents = (TreeMap) collections.get(p.doc.getCollection().getName())) == null) {				documents = new TreeMap();				collections.put(p.doc.getCollection().getName(), documents);			}			if ((hits = (Integer) documents.get(p.doc.getFileName())) == null)				documents.put(p.doc.getFileName(), new Integer(1));			else				documents.put(p.doc.getFileName(), new Integer(hits.intValue() + 1));		}		return collections;	}