Class Pair<A>

  • Type Parameters:
    A - the type of the paired objects

    public class Pair<A>
    extends java.lang.Object
    The Pair groups two objects of the same type in a given order.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected A first  
      protected A second  
    • Constructor Summary

      Constructors 
      Constructor Description
      Pair​(A first, A second)
      Constructs a Pair with a first and a second element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      A getFirst()
      Returns the first element.
      A getSecond()
      Returns the second element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • first

        protected final A first
      • second

        protected final A second
    • Constructor Detail

      • Pair

        public Pair​(A first,
                    A second)
        Constructs a Pair with a first and a second element.
        Parameters:
        first - the first object
        second - the second object
    • Method Detail

      • getFirst

        public A getFirst()
        Returns the first element.
        Returns:
        the first element
      • getSecond

        public A getSecond()
        Returns the second element.
        Returns:
        the second element