Class Tuple<T,U>

java.lang.Object
solvers.dataStructures.Tuple<T,U>
Type Parameters:
T - The class of the first element of the Tuple
U - The class of the second element of the Tuple

public class Tuple<T,U> extends Object
The Tuple class provides objects which function just like a 2-tuple.
Author:
Michail Makaronidis, 2009, 2010
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tuple(T argX, U argY)
    Creates a new Tuple object gives its 2 elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the first element of a Tuple
    Returns the second element of a Tuple
    void
    setX(T t)
    Sets the first element of a Tuple
    void
    setY(U u)
    Sets the second element of a Tuple
    Returns a String object representing the Tuple.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Tuple

      public Tuple(T argX, U argY)
      Creates a new Tuple object gives its 2 elements.
      Parameters:
      argX - The first element
      argY - The second element
  • Method Details

    • getX

      public T getX()
      Returns the first element of a Tuple
      Returns:
      The first element
    • getY

      public U getY()
      Returns the second element of a Tuple
      Returns:
      The second element
    • setX

      public void setX(T t)
      Sets the first element of a Tuple
      Parameters:
      t - The first element
    • setY

      public void setY(U u)
      Sets the second element of a Tuple
      Parameters:
      u - The second element
    • toString

      public String toString()
      Returns a String object representing the Tuple.
      Overrides:
      toString in class Object
      Returns:
      The representing String object