Class Pair<A,​B>

  • Type Parameters:
    A - The first element in the pair is an A.
    B - The second element in the pair is a B.
    All Implemented Interfaces:
    java.util.Map.Entry<A,​B>

    public final class Pair<A,​B>
    extends java.lang.Object
    implements java.util.Map.Entry<A,​B>
    A tuple of order two.
    Author:
    Alex Kalderimis This is also an implementation of Map.Entry, with the exception that setValue throws an error.
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(A a, B b)
      Construct a pair of two things
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      A getKey()  
      B getValue()  
      B setValue​(B value)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map.Entry

        equals, hashCode
    • Constructor Detail

      • Pair

        public Pair​(A a,
                    B b)
        Construct a pair of two things
        Parameters:
        a - Thing the first
        b - Thing the second
    • Method Detail

      • getKey

        public A getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<A,​B>
      • getValue

        public B getValue()
        Specified by:
        getValue in interface java.util.Map.Entry<A,​B>
      • setValue

        public B setValue​(B value)
        Specified by:
        setValue in interface java.util.Map.Entry<A,​B>
      • toString

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