Class Tuple2Encoding<V1,V2>

All Implemented Interfaces:
Encoding<Tuple2<V1,V2>>, NaturalSortAware, Serializable, Comparator<Tuple2<V1,V2>>

public class Tuple2Encoding<V1,V2> extends TupleEncoding<Tuple2<V1,V2>>
Composite encoding constructed from the concatenation of two component encodings.
See Also:
  • Constructor Details

    • Tuple2Encoding

      public Tuple2Encoding(EncodingId encodingId, Encoding<V1> value1Encoding, Encoding<V2> value2Encoding)
      Constructor.
      Parameters:
      encodingId - encoding ID, or null for an anonymous instance
      value1Encoding - component value encoding
      value2Encoding - component value encoding
      Throws:
      IllegalArgumentException - if any component value encoding is null
  • Method Details

    • withEncodingId

      public Tuple2Encoding<V1,V2> withEncodingId(EncodingId encodingId)
      Description copied from interface: Encoding
      Build an encoding that has the given EncodingId but is otherwise equivalent to this encoding.

      If this encoding already has encodingId, then this method may (but is not required to) return this same instance.

      Parameters:
      encodingId - new encoding's EncodingId, or null for an anonymized encoding
      Returns:
      a version of this encoding with the given EncodingId
    • createTuple

      protected Tuple2<V1,V2> createTuple(Object[] values)
      Specified by:
      createTuple in class TupleEncoding<Tuple2<V1,V2>>