Class Tuple<X,​Y>

  • Type Parameters:
    X - First element type
    Y - Second element type
    All Implemented Interfaces:
    Serializable

    public final class Tuple<X,​Y>
    extends Object
    implements Serializable
    This class represents a tuple.
    See Also:
    Serialized Form
    • Field Detail

      • first

        public X first
        First element.
      • second

        public Y second
        Second element.
    • Constructor Detail

      • Tuple

        public Tuple()
        Tuple empty constructor.
      • Tuple

        public Tuple​(X newfirst,
                     Y newsecond)
        Tuple constructor
        Parameters:
        newfirst - First element.
        newsecond - Second element.
    • Method Detail

      • getFirst

        public X getFirst()
        Get the Tuple::first
        Returns:
        the first
      • setFirst

        public void setFirst​(X newfirst)
        Set the Tuple::first
        Parameters:
        newfirst - the first to set
      • getSecond

        public Y getSecond()
        Get the Tuple::second
        Returns:
        the second
      • setSecond

        public void setSecond​(Y newsecond)
        Set the Tuple::second
        Parameters:
        newsecond - the second to set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object