Class Pair<A,​B>


  • public final class Pair<A,​B>
    extends java.lang.Object
    A simple class that holds a pair of values. There are many implementations of this but i didnt want to pull in another library only for a simple class.
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(A first, B second)
      Create a pair of values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      A getFirst()
      Get the first of the pair.
      B getSecond()
      Get the second of the pair.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Pair

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

      • getFirst

        public A getFirst()
        Get the first of the pair.
        Returns:
        first of the pair
      • getSecond

        public B getSecond()
        Get the second of the pair.
        Returns:
        second of the pair
      • toString

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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