- java.lang.Object
-
- org.apache.lucene.util.fst.FSTEnum<T>
-
- org.apache.lucene.util.fst.BytesRefFSTEnum<T>
-
public final class BytesRefFSTEnum<T> extends FSTEnum<T>
Enumerates all input (BytesRef) + output pairs in an FST.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BytesRefFSTEnum.InputOutput<T>
Holds a single input (BytesRef) + output pair.
-
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 int
getCurrentLabel()
protected int
getTargetLabel()
protected void
grow()
BytesRefFSTEnum.InputOutput<T>
next()
BytesRefFSTEnum.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 void
setCurrentLabel(int label)
private BytesRefFSTEnum.InputOutput<T>
setResult()
-
Methods inherited from class org.apache.lucene.util.fst.FSTEnum
doNext, doSeekCeil, doSeekExact, doSeekFloor
-
-
-
-
Field Detail
-
current
private final BytesRef current
-
result
private final BytesRefFSTEnum.InputOutput<T> result
-
target
private BytesRef target
-
-
Method Detail
-
current
public BytesRefFSTEnum.InputOutput<T> current()
-
next
public BytesRefFSTEnum.InputOutput<T> next() throws java.io.IOException
- Throws:
java.io.IOException
-
seekCeil
public BytesRefFSTEnum.InputOutput<T> seekCeil(BytesRef target) throws java.io.IOException
Seeks to smallest term that's >= target.- Throws:
java.io.IOException
-
seekFloor
public BytesRefFSTEnum.InputOutput<T> seekFloor(BytesRef target) throws java.io.IOException
Seeks to biggest term that's <= target.- Throws:
java.io.IOException
-
seekExact
public BytesRefFSTEnum.InputOutput<T> seekExact(BytesRef target) throws java.io.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:
java.io.IOException
-
getTargetLabel
protected int getTargetLabel()
- Specified by:
getTargetLabel
in classFSTEnum<T>
-
getCurrentLabel
protected int getCurrentLabel()
- Specified by:
getCurrentLabel
in classFSTEnum<T>
-
setCurrentLabel
protected void setCurrentLabel(int label)
- Specified by:
setCurrentLabel
in classFSTEnum<T>
-
setResult
private BytesRefFSTEnum.InputOutput<T> setResult()
-
-