Package org.apache.lucene.util.fst
Class BytesRefFSTEnum<T>
- java.lang.Object
 - 
- org.apache.lucene.util.fst.BytesRefFSTEnum<T>
 
 
- 
public final class BytesRefFSTEnum<T> extends Object
Enumerates all input (BytesRef) + output pairs in an FST.- WARNING: This API is experimental and might change in incompatible ways in the next release.
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBytesRefFSTEnum.InputOutput<T>Holds a single input (BytesRef) + output pair. 
- 
Field Summary
Fields Modifier and Type Field Description protected FST.Arc<T>[]arcsprotected FST<T>fstprotected FST.BytesReaderfstReaderprotected TNO_OUTPUTprotected T[]outputprotected FST.Arc<T>scratchArcprotected inttargetLengthprotected intupto 
- 
Constructor Summary
Constructors Constructor Description BytesRefFSTEnum(FST<T> fst)doFloor controls the behavior of advance: if it's true doFloor is true, advance positions to the biggest term before target. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytesRefFSTEnum.InputOutput<T>current()protected voiddoNext()protected voiddoSeekCeil()Seeks to smallest term that's >= target.protected booleandoSeekExact()Seeks to exactly target term.protected voiddoSeekFloor()Seeks to largest term that's <= target.protected intgetCurrentLabel()protected intgetTargetLabel()protected voidgrow()BytesRefFSTEnum.InputOutput<T>next()protected voidrewindPrefix()Rewinds enum state to match the shared prefix between current term and target termBytesRefFSTEnum.InputOutput<T>seekCeil(BytesRef target)Seeks to smallest term that's >= target.BytesRefFSTEnum.InputOutput<T>seekExact(BytesRef target)Seeks to exactly this term, returning null if the term doesn't exist.BytesRefFSTEnum.InputOutput<T>seekFloor(BytesRef target)Seeks to biggest term that's <= target.protected voidsetCurrentLabel(int label) 
 - 
 
- 
- 
Field Detail
- 
fst
protected final FST<T> fst
 
- 
arcs
protected FST.Arc<T>[] arcs
 
- 
output
protected T[] output
 
- 
NO_OUTPUT
protected final T NO_OUTPUT
 
- 
fstReader
protected final FST.BytesReader fstReader
 
- 
scratchArc
protected final FST.Arc<T> scratchArc
 
- 
upto
protected int upto
 
- 
targetLength
protected int targetLength
 
 - 
 
- 
Method Detail
- 
current
public BytesRefFSTEnum.InputOutput<T> current()
 
- 
next
public BytesRefFSTEnum.InputOutput<T> next() throws IOException
- Throws:
 IOException
 
- 
seekCeil
public BytesRefFSTEnum.InputOutput<T> seekCeil(BytesRef target) throws IOException
Seeks to smallest term that's >= target.- Throws:
 IOException
 
- 
seekFloor
public BytesRefFSTEnum.InputOutput<T> seekFloor(BytesRef target) throws IOException
Seeks to biggest term that's <= target.- Throws:
 IOException
 
- 
seekExact
public BytesRefFSTEnum.InputOutput<T> seekExact(BytesRef target) throws IOException
Seeks to exactly this term, returning null if the term doesn't exist. This is faster than usingseekFloor(org.apache.lucene.util.BytesRef)orseekCeil(org.apache.lucene.util.BytesRef)because it short-circuits as soon the match is not found.- Throws:
 IOException
 
- 
getTargetLabel
protected int getTargetLabel()
 
- 
getCurrentLabel
protected int getCurrentLabel()
 
- 
setCurrentLabel
protected void setCurrentLabel(int label)
 
- 
grow
protected void grow()
 
- 
rewindPrefix
protected final void rewindPrefix() throws IOExceptionRewinds enum state to match the shared prefix between current term and target term- Throws:
 IOException
 
- 
doNext
protected void doNext() throws IOException- Throws:
 IOException
 
- 
doSeekCeil
protected void doSeekCeil() throws IOExceptionSeeks to smallest term that's >= target.- Throws:
 IOException
 
- 
doSeekFloor
protected void doSeekFloor() throws IOExceptionSeeks to largest term that's <= target.- Throws:
 IOException
 
- 
doSeekExact
protected boolean doSeekExact() throws IOExceptionSeeks to exactly target term.- Throws:
 IOException
 
 - 
 
 -