Class FSTDictionary.Browser
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.FSTDictionary.Browser
-
- All Implemented Interfaces:
IndexDictionary.Browser
- Enclosing class:
- FSTDictionary
protected class FSTDictionary.Browser extends java.lang.Object implements IndexDictionary.Browser
-
-
Field Summary
Fields Modifier and Type Field Description protected long
blockFilePointer
protected int
blockPrefixLen
protected BytesRefFSTEnum<java.lang.Long>
fstEnum
protected BytesRefBuilder
keyBuilder
protected int
state
protected static int
STATE_END
protected static int
STATE_NEXT
protected static int
STATE_SEEK
-
Constructor Summary
Constructors Modifier Constructor Description protected
Browser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBlockFilePointer()
Returns the block file pointer associated with the key returned.int
getBlockPrefixLen()
Returns the number of characters of this block's key that is in common with all terms in this block.BytesRef
nextKey()
Returns the next block key and positions the browser at this key.BytesRef
peekKey()
Returns the next key without advancing.long
seekBlock(BytesRef term)
Seeks the given term in theIndexDictionary
and returns its corresponding block file pointer.
-
-
-
Field Detail
-
fstEnum
protected final BytesRefFSTEnum<java.lang.Long> fstEnum
-
STATE_SEEK
protected static final int STATE_SEEK
- See Also:
- Constant Field Values
-
STATE_NEXT
protected static final int STATE_NEXT
- See Also:
- Constant Field Values
-
STATE_END
protected static final int STATE_END
- See Also:
- Constant Field Values
-
state
protected int state
-
keyBuilder
protected final BytesRefBuilder keyBuilder
-
blockPrefixLen
protected int blockPrefixLen
-
blockFilePointer
protected long blockFilePointer
-
-
Method Detail
-
seekBlock
public long seekBlock(BytesRef term)
Description copied from interface:IndexDictionary.Browser
Seeks the given term in theIndexDictionary
and returns its corresponding block file pointer.- Specified by:
seekBlock
in interfaceIndexDictionary.Browser
- Returns:
- The block file pointer corresponding to the term if it matches
exactly a block key in the dictionary.
Otherwise the floor block key, which is the greatest block key present
in the dictionary that is alphabetically preceding the searched term.
Otherwise
-1
if there is no floor block key because the searched term precedes alphabetically the first block key of the dictionary.
-
nextKey
public BytesRef nextKey()
Description copied from interface:IndexDictionary.Browser
Returns the next block key and positions the browser at this key. A key is a prefix of a term in the dictionary. If seekBlock was just called then this is the current block key.- Specified by:
nextKey
in interfaceIndexDictionary.Browser
-
peekKey
public BytesRef peekKey()
Description copied from interface:IndexDictionary.Browser
Returns the next key without advancing. Only call this afterIndexDictionary.Browser.nextKey()
returns a non-null result.- Specified by:
peekKey
in interfaceIndexDictionary.Browser
-
getBlockPrefixLen
public int getBlockPrefixLen()
Description copied from interface:IndexDictionary.Browser
Returns the number of characters of this block's key that is in common with all terms in this block. Only call this afterIndexDictionary.Browser.nextKey()
returns a non-null result.- Specified by:
getBlockPrefixLen
in interfaceIndexDictionary.Browser
-
getBlockFilePointer
public long getBlockFilePointer()
Description copied from interface:IndexDictionary.Browser
Returns the block file pointer associated with the key returned. Only call this afterIndexDictionary.Browser.nextKey()
returns a non-null result.- Specified by:
getBlockFilePointer
in interfaceIndexDictionary.Browser
-
-