Class Pair<O1,​O2>


  • public class Pair<O1,​O2>
    extends Object
    • Field Detail

      • first

        public final O1 first
        The first element in the pair.
      • second

        public final O2 second
        The second element in the pair.
    • Constructor Detail

      • Pair

        public Pair​(O1 first,
                    O2 second)
        Construct a Pair.
        Parameters:
        a - The first element in the pair.
        b - The second element in the pair.
    • Method Detail

      • newPair

        public static <T1,​T2> Pair<T1,​T2> newPair​(T1 o1,
                                                              T2 o2)
        A factory method to create instance of Pair.
        Parameters:
        o1 - - the first element in the pair
        o2 - - the second element in the pair
        Returns:
        a instance of this class
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object