Package org.apache.lucene.util.fst
Class UpToTwoPositiveIntOutputs
- java.lang.Object
-
- org.apache.lucene.util.fst.Outputs<Object>
-
- org.apache.lucene.util.fst.UpToTwoPositiveIntOutputs
-
public final class UpToTwoPositiveIntOutputs extends Outputs<Object>
An FSTOutputs
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 resulting FST is not guaranteed to be minimal! SeeBuilder
.- 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 class
UpToTwoPositiveIntOutputs.TwoLongs
Holds two long outputs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
add(Object _prefix, Object _output)
Eg add("foo", "bar") -> "foobar"Long
common(Object _output1, Object _output2)
Eg common("foo", "foobar") -> "foo"Long
get(long v)
UpToTwoPositiveIntOutputs.TwoLongs
get(long first, long second)
Object
getNoOutput()
NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no outputstatic UpToTwoPositiveIntOutputs
getSingleton(boolean doShare)
Object
merge(Object first, Object second)
String
outputToString(Object output)
Object
read(DataInput in)
Long
subtract(Object _output, Object _inc)
Eg subtract("foobar", "foo") -> "bar"void
write(Object _output, DataOutput out)
-
-
-
Method Detail
-
getSingleton
public static UpToTwoPositiveIntOutputs getSingleton(boolean doShare)
-
get
public Long get(long v)
-
get
public UpToTwoPositiveIntOutputs.TwoLongs get(long first, long second)
-
common
public Long common(Object _output1, Object _output2)
Description copied from class:Outputs
Eg common("foo", "foobar") -> "foo"
-
subtract
public Long subtract(Object _output, Object _inc)
Description copied from class:Outputs
Eg subtract("foobar", "foo") -> "bar"
-
add
public Object add(Object _prefix, Object _output)
Description copied from class:Outputs
Eg add("foo", "bar") -> "foobar"
-
write
public void write(Object _output, DataOutput out) throws IOException
- Specified by:
write
in classOutputs<Object>
- Throws:
IOException
-
read
public Object read(DataInput in) throws IOException
- Specified by:
read
in classOutputs<Object>
- Throws:
IOException
-
getNoOutput
public Object getNoOutput()
Description copied from class:Outputs
NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output- Specified by:
getNoOutput
in classOutputs<Object>
-
outputToString
public String outputToString(Object output)
- Specified by:
outputToString
in classOutputs<Object>
-
-