Class Pair<A,​B>

  • Type Parameters:
    A - type parameter for first element in pair
    B - type parameter for second element in pair
    All Implemented Interfaces:
    java.io.Serializable

    public class Pair<A,​B>
    extends java.lang.Object
    implements java.io.Serializable
    A simple pair.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(A first, B second)
      Create a pair of first and second
    • Constructor Detail

      • Pair

        public Pair​(A first,
                    B second)
        Create a pair of first and second
        Parameters:
        first - The first pair member
        second - The second pair member
    • Method Detail

      • getFirst

        public A getFirst()
        Returns:
        The first pair member
      • setFirst

        public void setFirst​(A first)
        Set the first pair member
        Parameters:
        first - The new first pair member
      • getSecond

        public B getSecond()
        Returns:
        The second pair member
      • setSecond

        public void setSecond​(B second)
        Set the second pair member
        Parameters:
        second - The new second pair member
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object