|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.dictionary.DiskDictionary.DiskDictionaryIterator
public class DiskDictionary.DiskDictionaryIterator
A class that can be used as an iterator for this block.
Field Summary | |
---|---|
protected boolean |
actualOnly
A flag indicating whether we should try to ignore entries whose names have not actually occurred in the indexed material. |
protected PostingsInput[] |
buffChans
Buffered channels for reading postings. |
protected boolean |
casedEntries
Whether our entries are cased. |
protected Entry |
curr
The current entry. |
protected int |
estSize
The estimated size of the results set for this iterator. |
protected DiskDictionary.LookupState |
lus
Our lookup state. |
protected int |
pos
The position in the dictionary. |
protected java.lang.Object |
prevName
The name of the previous entry. |
protected boolean |
returnCurr
|
protected int |
startPos
The position to start iterating from |
protected int |
stopPos
The position to stop iterating at |
Constructor Summary | |
---|---|
DiskDictionary.DiskDictionaryIterator(int begin,
int end)
Gets an iterator for the dictionary that starts and stops at the given indices in the dictionary. |
|
DiskDictionary.DiskDictionaryIterator(java.lang.Object startEntry,
boolean includeStart,
java.lang.Object stopEntry,
boolean includeStop)
Creates a DictionaryIterator that iterates over a range of entries. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
|
int |
estimateSize()
Estimates the size of the document set that would be returned for all the entries that this iterator would produce. |
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 |
---|
protected int estSize
protected int pos
protected DiskDictionary.LookupState lus
protected java.lang.Object prevName
protected Entry curr
protected int startPos
protected int stopPos
protected PostingsInput[] buffChans
protected boolean actualOnly
protected boolean casedEntries
protected boolean returnCurr
Constructor Detail |
---|
public DiskDictionary.DiskDictionaryIterator(java.lang.Object startEntry, boolean includeStart, java.lang.Object stopEntry, boolean includeStop)
startEntry
- the name of the entry to start iterating at,
or null to start at the first entryincludeStart
- if true
and
startEntry
is non-null
, then the
iterator will return startEntry
, if it is in the
dictionary.stopEntry
- the name of the entry to stop iterating at,
or null to stop after the last entry.includeStop
- if true
and
stopEntry
is non-null
, then the
iterator will return stopEntry
, if it is in the
dictionary.public DiskDictionary.DiskDictionaryIterator(int begin, int end)
begin
- the beginning index in the dictionary, counting from
0. If this value is less than zero it will be clamped to zero.end
- the ending index in the dictionary, counting from 0. If
this value is greater than the number of entries in the dictionary,
it will be limited to that number.Method Detail |
---|
public void setActualOnly(boolean actualOnly)
true
.
Note that this option really only makes sense for dictionaries that use cased entries.
setActualOnly
in interface DictionaryIterator
actualOnly
- if true
only entries with names
that actually occurred in the indexed material will be returned.
If false
all entries will be returned.public boolean hasNext()
hasNext
in interface java.util.Iterator<QueryEntry>
public QueryEntry next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator<QueryEntry>
java.util.NoSuchElementException
public void remove()
remove
in interface java.util.Iterator<QueryEntry>
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public int estimateSize()
estimateSize
in interface DictionaryIterator
public int getNEntries()
DictionaryIterator
getNEntries
in interface DictionaryIterator
public QueryEntry get(int id)
DictionaryIterator
get
in interface DictionaryIterator
public QueryEntry get(java.lang.Object name)
DictionaryIterator
get
in interface DictionaryIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |