com.sun.labs.minion.indexer.dictionary
Class MemoryDictionary.MemoryDictionaryIterator

java.lang.Object
  extended by com.sun.labs.minion.indexer.dictionary.MemoryDictionary.MemoryDictionaryIterator
All Implemented Interfaces:
DictionaryIterator, java.util.Iterator<QueryEntry>
Enclosing class:
MemoryDictionary

public class MemoryDictionary.MemoryDictionaryIterator
extends java.lang.Object
implements DictionaryIterator

A class that implements a dictionary iterator for this dictionary.


Field Summary
protected  boolean actualOnly
           
protected  java.util.Iterator iter
           
 
Constructor Summary
MemoryDictionary.MemoryDictionaryIterator()
           
 
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.
 boolean hasNext()
           
 QueryEntry next()
           
 void remove()
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iter

protected java.util.Iterator iter

actualOnly

protected boolean actualOnly
Constructor Detail

MemoryDictionary.MemoryDictionaryIterator

public MemoryDictionary.MemoryDictionaryIterator()
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<QueryEntry>

next

public QueryEntry next()
Specified by:
next in interface java.util.Iterator<QueryEntry>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<QueryEntry>

estimateSize

public int estimateSize()
Description copied from interface: DictionaryIterator
Estimates the total size of the documents held in the postings for all of the terms in the iterator.

Specified by:
estimateSize in interface DictionaryIterator

getNEntries

public int getNEntries()
Description copied from interface: DictionaryIterator
Gets the number of entries that will be returned by this iterator.

Specified by:
getNEntries in interface DictionaryIterator

setActualOnly

public void setActualOnly(boolean actualOnly)
Description copied from interface: DictionaryIterator
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.

Specified by:
setActualOnly in interface DictionaryIterator
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.

get

public QueryEntry get(java.lang.Object name)
Description copied from interface: DictionaryIterator
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.

Specified by:
get in interface DictionaryIterator

get

public QueryEntry get(int id)
Description copied from interface: DictionaryIterator
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.

Specified by:
get in interface DictionaryIterator