com.sun.labs.minion.indexer.dictionary
Class ArrayDictionaryIterator

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

public class ArrayDictionaryIterator
extends java.lang.Object
implements DictionaryIterator

A dictionary iterator for an array of terms.


Constructor Summary
ArrayDictionaryIterator(DiskDictionary dd, QueryEntry[] entries)
           
ArrayDictionaryIterator(DiskDictionary dd, QueryEntry[] entries, int begin, int end)
           
ArrayDictionaryIterator(DiskDictionary dd, QueryEntry[] entries, int begin, int end, PostingsInput[] buffInputs)
           
ArrayDictionaryIterator(DiskDictionary dd, QueryEntry[] entries, PostingsInput[] buffInputs)
           
 
Method Summary
 int estimateSize()
          Estimates the number of documents in the postings for the entries represented by this 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()
          Describe hasNext method here.
 QueryEntry next()
          Describe next method here.
 void remove()
          Describe remove method here.
 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
 

Constructor Detail

ArrayDictionaryIterator

public ArrayDictionaryIterator(DiskDictionary dd,
                               QueryEntry[] entries)

ArrayDictionaryIterator

public ArrayDictionaryIterator(DiskDictionary dd,
                               QueryEntry[] entries,
                               PostingsInput[] buffInputs)

ArrayDictionaryIterator

public ArrayDictionaryIterator(DiskDictionary dd,
                               QueryEntry[] entries,
                               int begin,
                               int end)

ArrayDictionaryIterator

public ArrayDictionaryIterator(DiskDictionary dd,
                               QueryEntry[] entries,
                               int begin,
                               int end,
                               PostingsInput[] buffInputs)
Method Detail

remove

public void remove()
Describe remove method here.

Specified by:
remove in interface java.util.Iterator<QueryEntry>

next

public QueryEntry next()
Describe next method here.

Specified by:
next in interface java.util.Iterator<QueryEntry>
Returns:
an Object value

hasNext

public boolean hasNext()
Describe hasNext method here.

Specified by:
hasNext in interface java.util.Iterator<QueryEntry>
Returns:
a boolean value

estimateSize

public int estimateSize()
Estimates the number of documents in the postings for the entries represented by this iterator

Specified by:
estimateSize in interface DictionaryIterator
Returns:
an estimate of the number of documents for the postings in the entries represented by this iterator. Note that this is likely an overestimate.

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