tribble.util
Class Tuple3<T1,T2,T3>

java.lang.Object
  extended by tribble.util.Tuple3<T1,T2,T3>

public class Tuple3<T1,T2,T3>
extends java.lang.Object

Holds three values, i.e., is a 3-tuple. The first value is of type T1, the second is of type T2, and the third is of type T3.

Source code:
Available at: http://david.tribble.com/src/java
Documentation:
Available at: http://david.tribble.com/docs/tribble/util/Tuple3.html

Note: This requires Java 1.5 or later.

Since:
2008-09-12
Version:
@(#)$Revision: 1.3 $ $Date: 2008/09/17 19:17:05 $
Author:
David R. Tribble (david@tribble.com)

Copyright 2008 by David R. Tribble, all rights reserved.
Permission is granted to any person or entity except those designated by by the United States Department of State as a terrorist, or terrorist government or agency, to use and distribute this source code provided that the original copyright notice remains present and unaltered.

See Also:
Pair

Field Summary
protected  T1 m_val1
          First value of this tuple.
protected  T2 m_val2
          Second value of this tuple.
protected  T3 m_val3
          Third value of this tuple.
 
Constructor Summary
Tuple3()
          Default constructor.
Tuple3(T1 val1, T2 val2, T3 val3)
          Constructor.
Tuple3(Tuple3<T1,T2,T3> tup)
          Constructor.
 
Method Summary
 Tuple3<T1,T2,T3> clone()
          Create a copy of the tuple.
 T1 getValue1()
          Retrieve the first value of the tuple.
 T2 getValue2()
          Retrieve the second value of the tuple.
 T3 getValue3()
          Retrieve the third value of the tuple.
 void setValue1(T1 val)
          Set the first value of the tuple.
 void setValue2(T2 val)
          Set the second value of the tuple.
 void setValue3(T3 val)
          Set the third value of the tuple.
 java.lang.String toString()
          Produce a string representation of the tuple.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_val1

protected T1 m_val1
First value of this tuple.


m_val2

protected T2 m_val2
Second value of this tuple.


m_val3

protected T3 m_val3
Third value of this tuple.

Constructor Detail

Tuple3

public Tuple3()
Default constructor.

Since:
1.1, 2008-09-12

Tuple3

public Tuple3(T1 val1,
              T2 val2,
              T3 val3)
Constructor.

Parameters:
val1 - First value contained in the tuple.
val2 - Second value contained in the tuple.
val3 - Third value contained in the tuple.
Since:
1.1, 2008-09-12

Tuple3

public Tuple3(Tuple3<T1,T2,T3> tup)
Constructor.

Parameters:
tup - Another tuple, from which the contents of this tuple are copied.
Since:
1.3, 2008-09-17
Method Detail

getValue1

public T1 getValue1()
Retrieve the first value of the tuple.

Since:
1.1, 2008-09-12

setValue1

public void setValue1(T1 val)
Set the first value of the tuple.

Since:
1.1, 2008-09-12

getValue2

public T2 getValue2()
Retrieve the second value of the tuple.

Since:
1.1, 2008-09-12

setValue2

public void setValue2(T2 val)
Set the second value of the tuple.

Since:
1.1, 2008-09-12

getValue3

public T3 getValue3()
Retrieve the third value of the tuple.

Since:
1.1, 2008-09-12

setValue3

public void setValue3(T3 val)
Set the third value of the tuple.

Since:
1.1, 2008-09-12

clone

public Tuple3<T1,T2,T3> clone()
Create a copy of the tuple.

Overrides:
clone in class java.lang.Object
Since:
1.3, 2008-09-17

toString

public java.lang.String toString()
Produce a string representation of the tuple. The string is equivalent to:
    "{" + getItem1().toString() + "; " + getItem2().toString() + "; " + getItem3().toString() + "}"
If any of the objects in the tuple is null, their text in the string is "null".

Overrides:
toString in class java.lang.Object
Since:
1.3, 2008-09-17