Package org.apache.lucene.util.fst
Class Outputs<T>
java.lang.Object
org.apache.lucene.util.fst.Outputs<T>
- Direct Known Subclasses:
ByteSequenceOutputs,CharSequenceOutputs,IntSequenceOutputs,NoOutputs,PairOutputs,PositiveIntOutputs
Represents the outputs for an FST, providing the basic algebra required for building and
traversing the FST.
Note that any operation that returns NO_OUTPUT must return the same singleton object from
getNoOutput().
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TEg add("foo", "bar") -> "foobar"abstract TEg common("foobar", "food") -> "foo"abstract TNOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no outputabstract StringoutputToString(T output) abstract longramBytesUsed(T output) Return memory usage for the provided output.abstract TDecode an output value previously written withwrite(Object, DataOutput).Decode an output value previously written withwriteFinalOutput(Object, DataOutput).voidSkip the output previously written withwriteFinalOutput(T, org.apache.lucene.store.DataOutput); defaults to just callingreadFinalOutput(org.apache.lucene.store.DataInput)and discarding the result.voidskipOutput(DataInput in) Skip the output; defaults to just callingread(org.apache.lucene.store.DataInput)and discarding the result.abstract TEg subtract("foobar", "foo") -> "bar"abstract voidwrite(T output, DataOutput out) Encode an output value into aDataOutput.voidwriteFinalOutput(T output, DataOutput out) Encode an final node output value into aDataOutput.
-
Constructor Details
-
Outputs
public Outputs()
-
-
Method Details
-
common
Eg common("foobar", "food") -> "foo" -
subtract
Eg subtract("foobar", "foo") -> "bar" -
add
Eg add("foo", "bar") -> "foobar" -
write
Encode an output value into aDataOutput.- Throws:
IOException
-
writeFinalOutput
Encode an final node output value into aDataOutput. By default this just callswrite(Object, DataOutput).- Throws:
IOException
-
read
Decode an output value previously written withwrite(Object, DataOutput).- Throws:
IOException
-
skipOutput
Skip the output; defaults to just callingread(org.apache.lucene.store.DataInput)and discarding the result.- Throws:
IOException
-
readFinalOutput
Decode an output value previously written withwriteFinalOutput(Object, DataOutput). By default this just callsread(DataInput).- Throws:
IOException
-
skipFinalOutput
Skip the output previously written withwriteFinalOutput(T, org.apache.lucene.store.DataOutput); defaults to just callingreadFinalOutput(org.apache.lucene.store.DataInput)and discarding the result.- Throws:
IOException
-
getNoOutput
NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output -
outputToString
-
merge
-
ramBytesUsed
Return memory usage for the provided output.- See Also:
-