Class Trip<A>

  • Type Parameters:
    A - the type of the stored items

    public class Trip<A>
    extends java.lang.Object
    An ordered triple storing three items of type A
    • Constructor Summary

      Constructors 
      Constructor Description
      Trip​(A first, A second, A third)
      Creates a triple with three given items
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      A getFirst()
      Gets the first item in the triple
      A getSecond()
      Gets the second item in the triple
      A getThird()
      Gets the third item in the triple
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Trip

        public Trip​(A first,
                    A second,
                    A third)
        Creates a triple with three given items
        Parameters:
        first - the first item in the triple
        second - the second item in the triple
        third - the third item in the triple
    • Method Detail

      • getFirst

        public A getFirst()
        Gets the first item in the triple
        Returns:
        the first item in the triple
      • getSecond

        public A getSecond()
        Gets the second item in the triple
        Returns:
        the second item in the triple
      • getThird

        public A getThird()
        Gets the third item in the triple
        Returns:
        the third item in the triple
      • equals

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

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

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