Class Pair<F,​S>


  • public class Pair<F,​S>
    extends java.lang.Object
    An immutable pair of objects. This implements equals and hashCode by delegating to the pair objects.
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(F first, S second)
      Creates a pair.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      F getFirst()
      Returns the first member.
      S getSecond()
      Returns the second member.
      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​(F first,
                    S second)
        Creates a pair. Each member may be set to null.
    • Method Detail

      • getFirst

        public F getFirst()
        Returns the first member. This may be null.
      • getSecond

        public S getSecond()
        Returns the second member. This may be null.
      • hashCode

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

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

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