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 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 resulting FST is not guaranteed to be minimal! See `Builder`.

WARNING: This API is experimental and might change in incompatible ways in the next release.

### Nested Class Summary

Nested Classes
`static class` `UpToTwoPositiveIntOutputs.TwoLongs` Holds two long outputs.

### Method Summary

Methods
`Object` `add(Object _prefix, Object _output)`
`Long` `common(Object _output1, Object _output2)`
`Long` `get(long v)`
`UpToTwoPositiveIntOutputs.TwoLongs` `get(long first, long second)`
`Object` `getNoOutput()`
`static UpToTwoPositiveIntOutputs` `getSingleton(boolean doShare)`
`Object` `merge(Object first, Object second)`
`String` `outputToString(Object output)`
`Object` `read(DataInput in)`
`Long` `subtract(Object _output, Object _inc)`
`void` `write(Object _output, DataOutput out)`

### Methods inherited from class org.apache.lucene.util.fst.Outputs

`readFinalOutput, writeFinalOutput`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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)

Specified by:
  `common` in class `Outputs<Object>`

#### subtract

    public Long subtract(Object _output,
                Object _inc)

Specified by:
  `subtract` in class `Outputs<Object>`

#### add

    public Object add(Object _prefix,
             Object _output)

Specified by:
  `add` in class `Outputs<Object>`

#### write

    public void write(Object _output,
             DataOutput out)
               throws IOException

Specified by:
  `write` in class `Outputs<Object>`
Throws:
  `IOException`

#### read

    public Object read(DataInput in)
                throws IOException

Specified by:
  `read` in class `Outputs<Object>`
Throws:
  `IOException`

#### getNoOutput

    public Object getNoOutput()

Specified by:
  `getNoOutput` in class `Outputs<Object>`

#### outputToString

    public String outputToString(Object output)

Specified by:
  `outputToString` in class `Outputs<Object>`

#### merge

    public Object merge(Object first,
               Object second)

Overrides:
  `merge` in class `Outputs<Object>`