Class Triple<E,​F,​G>

  • Type Parameters:
    E - the type of the first element
    F - the type of the second element
    G - the type of the third element

    public class Triple<E,​F,​G>
    extends java.lang.Object
    This class implements a simple triple of elements.
    Author:
    Matthias Thimm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) E obj1
      The first element of this triple
      (package private) F obj2
      The second element of this triple
      (package private) G obj3
      The third element of this triple
    • Constructor Summary

      Constructors 
      Constructor Description
      Triple()
      Initializes an empty triple.
      Triple​(E obj1, F obj2, G obj3)
      Initializes the elements of this triple with the given parameters
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      E getFirst()
      returns the first element of this triple
      F getSecond()
      returns the second element of this triple
      G getThird()
      returns the third element of this triple
      int hashCode()  
      void setFirst​(E obj1)
      sets the first element of this triple
      void setSecond​(F obj2)
      sets the second element of this triple
      void setThird​(G obj3)
      sets the third element of this triple
      • Methods inherited from class java.lang.Object

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

      • obj1

        E obj1
        The first element of this triple
      • obj2

        F obj2
        The second element of this triple
      • obj3

        G obj3
        The third element of this triple
    • Constructor Detail

      • Triple

        public Triple​(E obj1,
                      F obj2,
                      G obj3)
        Initializes the elements of this triple with the given parameters
        Parameters:
        obj1 - the first element of this triple
        obj2 - the second element of this triple
        obj3 - the third element of this triple
      • Triple

        public Triple()
        Initializes an empty triple.
    • Method Detail

      • getFirst

        public E getFirst()
        returns the first element of this triple
        Returns:
        the first element of this triple
      • setFirst

        public void setFirst​(E obj1)
        sets the first element of this triple
        Parameters:
        obj1 - an object of type E
      • getSecond

        public F getSecond()
        returns the second element of this triple
        Returns:
        the second element of this triple
      • setSecond

        public void setSecond​(F obj2)
        sets the second element of this triple
        Parameters:
        obj2 - an object of type F
      • getThird

        public G getThird()
        returns the third element of this triple
        Returns:
        the third element of this triple
      • setThird

        public void setThird​(G obj3)
        sets the third element of this triple
        Parameters:
        obj3 - an object of type G
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object