Package org.apache.lucene.misc.util.fst
Class UpToTwoPositiveIntOutputs
java.lang.Object
org.apache.lucene.util.fst.Outputs<Object>
org.apache.lucene.misc.util.fst.UpToTwoPositiveIntOutputs
An FST
Outputs implementation where each output is one or two non-negative long values.
If it's a single output, Long is returned; else, TwoLongs. Order is preserved in the TwoLongs
case, ie .first is the first input/output added to Builder, and .second is the second. You cannot
store 0 output with this (that's reserved to mean "no output")!
NOTE: the only way to create a TwoLongs output is to add the same input to the FST twice in a
row. This is how the FST maps a single input to two outputs (e.g. you cannot pass a TwoLongs to
FSTCompiler.add(org.apache.lucene.util.IntsRef, T). If you need more than two then use ListOfOutputs, but if you
only have at most 2 then this implementation will require fewer bytes as it steals one bit from
each long value.
NOTE: the resulting FST is not guaranteed to be minimal! See FSTCompiler.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHolds two long outputs. -
Method Summary
Modifier and TypeMethodDescriptionget(long v) get(long first, long second) static UpToTwoPositiveIntOutputsgetSingleton(boolean doShare) outputToString(Object output) longvoidwrite(Object _output, DataOutput out) Methods inherited from class org.apache.lucene.util.fst.Outputs
readFinalOutput, skipFinalOutput, skipOutput, writeFinalOutput
-
Method Details
-
getSingleton
-
get
-
get
-
common
-
subtract
-
add
-
write
- Specified by:
writein classOutputs<Object>- Throws:
IOException
-
read
- Specified by:
readin classOutputs<Object>- Throws:
IOException
-
getNoOutput
- Specified by:
getNoOutputin classOutputs<Object>
-
outputToString
- Specified by:
outputToStringin classOutputs<Object>
-
merge
-
ramBytesUsed
- Specified by:
ramBytesUsedin classOutputs<Object>
-