Class UpToTwoPositiveIntOutputs


  • public final class UpToTwoPositiveIntOutputs
    extends Outputs<Object>
    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 Builder.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 Builder.