public final class ListOfOutputs<T> extends Outputs<Object>
Builder.add(IntsRef,Object)
multiple
times. The builder will then combine the outputs using
the Outputs.merge(Object,Object)
method.
The resulting FST may not be minimal when an input has more than one output, as this requires pushing all multi-output values to a final state.
NOTE: the only way to create multiple outputs is to
add the same input to the FST multiple times in a row. This is
how the FST maps a single input to multiple outputs (e.g. you
cannot pass a List<Object> to Builder.add(org.apache.lucene.util.IntsRef, T)
). If
your outputs are longs, and you need at most 2, then use
UpToTwoPositiveIntOutputs
instead since it stores
the outputs more compactly (by stealing a bit from each
long value).
NOTE: this cannot wrap itself (ie you cannot make an FST with List<List<Object>> outputs using this).
Constructor and Description |
---|
ListOfOutputs(Outputs<T> outputs) |
Modifier and Type | Method and Description |
---|---|
Object |
add(Object prefix,
Object output) |
List<T> |
asList(Object output) |
Object |
common(Object output1,
Object output2) |
Object |
getNoOutput() |
Object |
merge(Object first,
Object second) |
String |
outputToString(Object output) |
long |
ramBytesUsed(Object output) |
Object |
read(DataInput in) |
Object |
readFinalOutput(DataInput in) |
void |
skipFinalOutput(DataInput in) |
void |
skipOutput(DataInput in) |
Object |
subtract(Object object,
Object inc) |
String |
toString() |
void |
write(Object output,
DataOutput out) |
void |
writeFinalOutput(Object output,
DataOutput out) |
public void write(Object output, DataOutput out) throws IOException
write
in class Outputs<Object>
IOException
public void writeFinalOutput(Object output, DataOutput out) throws IOException
writeFinalOutput
in class Outputs<Object>
IOException
public Object read(DataInput in) throws IOException
read
in class Outputs<Object>
IOException
public void skipOutput(DataInput in) throws IOException
skipOutput
in class Outputs<Object>
IOException
public Object readFinalOutput(DataInput in) throws IOException
readFinalOutput
in class Outputs<Object>
IOException
public void skipFinalOutput(DataInput in) throws IOException
skipFinalOutput
in class Outputs<Object>
IOException
public Object getNoOutput()
getNoOutput
in class Outputs<Object>
public String outputToString(Object output)
outputToString
in class Outputs<Object>
public long ramBytesUsed(Object output)
ramBytesUsed
in class Outputs<Object>
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.