Class Tuple2<T1,​T2>

  • Type Parameters:
    T1 - the type of the 1st element
    T2 - the type of the 2nd element
    All Implemented Interfaces:
    Serializable, Tuple
    Direct Known Subclasses:
    Tuple3

    public class Tuple2<T1,​T2>
    extends Tuple1<T1>
    A Tuple of 2 elements.
    Since:
    2.0.0
    Author:
    Marcel Overdijk
    See Also:
    Serialized Form
    • Constructor Detail

      • Tuple2

        public Tuple2​(T1 element1,
                      T2 element2)
        Constructs a new Tuple with the supplied elements.
    • Method Detail

      • getElement2

        public T2 getElement2()
        Returns the 2nd element of this tuple.
        Returns:
        the 2nd element of this tuple
      • setElement2

        public void setElement2​(T2 element2)
        Sets the 2nd element of this tuple.
      • size

        public int size()
        Description copied from interface: Tuple
        Returns the number of elements of this tuple.
        Specified by:
        size in interface Tuple
        Overrides:
        size in class Tuple1<T1>
        Returns:
        the number of elements of this tuple