setChanged(); notifyObservers(progress);
if(progress.changed()) { setChanged(); notifyObservers(progress); }
		public void flush() {			final ProgressIndicator progress = new ProgressIndicator(words.size());			if (doc == null)				return;			final short collectionId = doc.getCollection().getId();			int count = 1, len;			Map.Entry entry;			String word;			LongLinkedList idList;			long[] ids;			byte[] data;			long prevId, id;			long delta;			for (Iterator i = words.entrySet().iterator(); i.hasNext(); count++) {				entry = (Map.Entry) i.next();				word = (String) entry.getKey();				idList = (LongLinkedList) entry.getValue();				i.remove();				len = idList.getSize();				os.writeInt(doc.getDocId());				os.writeInt(len);				prevId = 0;				for (Iterator j = idList.iterator(); j.hasNext();) {					id = ((LongLinkedList.ListItem) j.next()).l;					delta = id - prevId;					if (delta < 0) {						LOG.debug("neg. delta: " + delta + " for " + word);						LOG.debug("id = " + id + "; prev = " + prevId);					}					os.writeLong(delta);					prevId = id;				}				data = os.toByteArray();				os.clear();				flushWord(collectionId, word, data);				progress.setValue(count);				setChanged();				notifyObservers(progress);			}			words.clear();		}