com.sun.labs.minion.indexer.dictionary
Interface DictionaryIterator

All Superinterfaces:
java.util.Iterator<QueryEntry>
All Known Implementing Classes:
ArrayDictionaryIterator, DiskDictionary.DiskDictionaryIterator, MemoryDictionary.MemoryDictionaryIterator

public interface DictionaryIterator
extends java.util.Iterator<QueryEntry>

An interface for iterators for a dictionary.


Method Summary
 int estimateSize()
          Estimates the total size of the documents held in the postings for all of the terms in the iterator.
 QueryEntry get(int id)
          Gets an entry for a specific ID from the dictionary that this iterator is iterating through.
 QueryEntry get(java.lang.Object name)
          Gets an entry for a specific name from the dictionary that this iterator is iterating through.
 int getNEntries()
          Gets the number of entries that will be returned by this iterator.
 void setActualOnly(boolean actualOnly)
          Modifies the iterator so that it only returns entries whose names have actually occurred in the indexed material.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

estimateSize

int estimateSize()
Estimates the total size of the documents held in the postings for all of the terms in the iterator.


getNEntries

int getNEntries()
Gets the number of entries that will be returned by this iterator.


get

QueryEntry get(java.lang.Object name)
Gets an entry for a specific name from the dictionary that this iterator is iterating through. This is an atypical iterator method, but it may be a lot faster, especially if the implementation keeps a local copy of dictionary data for faster uncontended access.


get

QueryEntry get(int id)
Gets an entry for a specific ID from the dictionary that this iterator is iterating through. This is an atypical iterator method, but it may be a lot faster, especially if the implementation keeps a local copy of dictionary data for faster uncontended access.


setActualOnly

void setActualOnly(boolean actualOnly)
Modifies the iterator so that it only returns entries whose names have actually occurred in the indexed material. So, for example, if the word Dog occurs in the indexed material, and is the only occurrence of that word, then the entry dog in a cased dictionary would not be returned if this method is called with a value of true.

Note that this option really only makes sense for dictionaries that use cased entries.

Parameters:
actualOnly - if true only entries with names that actually occurred in the indexed material will be returned. If false all entries will be returned.