Module logicng

Class Pair<A,​B>

  • Type Parameters:
    A - the type parameter of the first entry
    B - the type parameter of the second entry
    Direct Known Subclasses:
    ComparablePair

    public class Pair<A,​B>
    extends Object
    Data structure for a pair.
    Since:
    1.0
    Version:
    1.2
    • Field Detail

      • a

        protected final A a
      • b

        protected final B b
    • Constructor Detail

      • Pair

        public Pair​(A a,
                    B b)
        Constructs a new pair.
        Parameters:
        a - the first entry
        b - the second entry
    • Method Detail

      • first

        public A first()
        Returns the first entry of this pair.
        Returns:
        the first entry
      • second

        public B second()
        Returns the second entry of this pair.
        Returns:
        the second entry
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object