if (!isSorted) { part.sort(); size += part.removeDuplicates(); } for (int j = 0; j < part.length; j++) { doc = part.array[j].doc; if (last == null || last.docId != doc.docId) ds.add(part.array[j].doc); last = doc; }
cachedDocuments.add(part.doc, false);
	public DocumentSet getDocumentSet() {	    DocumentSet ds = new DocumentSet();		if (!isSorted)			size = 0;		Part part;		DocumentImpl doc, last = null;		for (Iterator i = map.valueIterator(); i.hasNext();) {			part = (Part) i.next();			if (!isSorted) {				part.sort();				size += part.removeDuplicates();			}			for (int j = 0; j < part.length; j++) {				doc = part.array[j].doc;				if (last == null || last.docId != doc.docId)					ds.add(part.array[j].doc);				last = doc;			}		}		isSorted = true;		return ds;	}