org.apache.lucene.util.fst

## Class PairOutputs<A,B>

- java.lang.Object
- - org.apache.lucene.util.fst.Outputs<PairOutputs.Pair<A,B>>
  - - org.apache.lucene.util.fst.PairOutputs<A,B>

-     public class PairOutputs<A,B>
      extends Outputs<PairOutputs.Pair<A,B>>

  An FST `Outputs` implementation, holding two other outputs.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PairOutputs.Pair<A,B>` Holds a single pair of two outputs.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PairOutputs(Outputs<A> outputs1, Outputs<B> outputs2)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PairOutputs.Pair<A,B>` | `add(PairOutputs.Pair<A,B> prefix, PairOutputs.Pair<A,B> output)` Eg add("foo", "bar") -> "foobar"
    `PairOutputs.Pair<A,B>` | `common(PairOutputs.Pair<A,B> pair1, PairOutputs.Pair<A,B> pair2)` Eg common("foobar", "food") -> "foo"
    `PairOutputs.Pair<A,B>` | `getNoOutput()` NOTE: this output is compared with == so you must ensure that all methods return the single object if it's really no output
    `PairOutputs.Pair<A,B>` | `newPair(A a, B b)` Create a new Pair
    `String` | `outputToString(PairOutputs.Pair<A,B> output)`
    `long` | `ramBytesUsed(PairOutputs.Pair<A,B> output)` Return memory usage for the provided output.
    `PairOutputs.Pair<A,B>` | `read(DataInput in)` Decode an output value previously written with `Outputs.write(Object, DataOutput)`.
    `void` | `skipOutput(DataInput in)` Skip the output; defaults to just calling `Outputs.read(org.apache.lucene.store.DataInput)` and discarding the result.
    `PairOutputs.Pair<A,B>` | `subtract(PairOutputs.Pair<A,B> output, PairOutputs.Pair<A,B> inc)` Eg subtract("foobar", "foo") -> "bar"
    `String` | `toString()`
    `void` | `write(PairOutputs.Pair<A,B> output, DataOutput writer)` Encode an output value into a `DataOutput`.

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

      `merge, readFinalOutput, skipFinalOutput, writeFinalOutput`

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

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

- - ### Constructor Detail

    - #### PairOutputs

          public PairOutputs(Outputs<A> outputs1,
                             Outputs<B> outputs2)

  - ### Method Detail

    - #### newPair

          public PairOutputs.Pair<A,B> newPair(A a,
                                               B b)

      Create a new Pair

    - #### common

          public PairOutputs.Pair<A,B> common(PairOutputs.Pair<A,B> pair1,
                                              PairOutputs.Pair<A,B> pair2)

      Description copied from class: `Outputs`
      Eg common("foobar", "food") -> "foo"
      Specified by:
        `common` in class `Outputs<PairOutputs.Pair<A,B>>`

    - #### subtract

          public PairOutputs.Pair<A,B> subtract(PairOutputs.Pair<A,B> output,
                                                PairOutputs.Pair<A,B> inc)

      Description copied from class: `Outputs`
      Eg subtract("foobar", "foo") -> "bar"
      Specified by:
        `subtract` in class `Outputs<PairOutputs.Pair<A,B>>`

    - #### add

          public PairOutputs.Pair<A,B> add(PairOutputs.Pair<A,B> prefix,
                                           PairOutputs.Pair<A,B> output)

      Description copied from class: `Outputs`
      Eg add("foo", "bar") -> "foobar"
      Specified by:
        `add` in class `Outputs<PairOutputs.Pair<A,B>>`

    - #### write

          public void write(PairOutputs.Pair<A,B> output,
                            DataOutput writer)
                     throws IOException

      Description copied from class: `Outputs`
      Encode an output value into a `DataOutput`.
      Specified by:
        `write` in class `Outputs<PairOutputs.Pair<A,B>>`
      Throws:
        `IOException`

    - #### read

          public PairOutputs.Pair<A,B> read(DataInput in)
                                     throws IOException

      Description copied from class: `Outputs`
      Decode an output value previously written with `Outputs.write(Object, DataOutput)`.
      Specified by:
        `read` in class `Outputs<PairOutputs.Pair<A,B>>`
      Throws:
        `IOException`

    - #### skipOutput

          public void skipOutput(DataInput in)
                          throws IOException

      Description copied from class: `Outputs`
      Skip the output; defaults to just calling `Outputs.read(org.apache.lucene.store.DataInput)` and discarding the result.
      Overrides:
        `skipOutput` in class `Outputs<PairOutputs.Pair<A,B>>`
      Throws:
        `IOException`

    - #### getNoOutput

          public PairOutputs.Pair<A,B> 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 class `Outputs<PairOutputs.Pair<A,B>>`

    - #### outputToString

          public String outputToString(PairOutputs.Pair<A,B> output)

      Specified by:
        `outputToString` in class `Outputs<PairOutputs.Pair<A,B>>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### ramBytesUsed

          public long ramBytesUsed(PairOutputs.Pair<A,B> output)

      Description copied from class: `Outputs`
      Return memory usage for the provided output.
      Specified by:
        `ramBytesUsed` in class `Outputs<PairOutputs.Pair<A,B>>`
      See Also:
        `Accountable`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.