com.foxsmart.ic.lang
Class Tuple

java.lang.Object
  extended by com.foxsmart.ic.lang.Tuple
All Implemented Interfaces:
java.io.Serializable

public class Tuple
extends java.lang.Object
implements java.io.Serializable

This class represents a tuple (i.e. it contains 2 objects). You kinda wonder why something like this isn't available in the standard Java JDK.

See Also:
Serialized Form

Constructor Summary
Tuple()
          Constructs a tuple object.
Tuple(java.lang.Object value1, java.lang.Object value2)
          Constructs a tuple object while specifying both values.
 
Method Summary
 boolean equals(java.lang.Object tupleObject)
          Determines if two Tuples are equal.
 java.lang.Object getValue1()
          Gets the first value.
 java.lang.Object getValue2()
          Gets the second value.
 void setValue1(java.lang.Object value1)
          Sets the first value.
 void setValue2(java.lang.Object value2)
          Sets the second value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tuple

public Tuple()
Constructs a tuple object. Both values will be null.


Tuple

public Tuple(java.lang.Object value1,
             java.lang.Object value2)
Constructs a tuple object while specifying both values.

Parameters:
value1 - the first value.
value2 - the second value.
Method Detail

setValue1

public void setValue1(java.lang.Object value1)
Sets the first value.

Parameters:
value1 - The first value.

getValue1

public java.lang.Object getValue1()
Gets the first value.

Returns:
the first value.

setValue2

public void setValue2(java.lang.Object value2)
Sets the second value.

Parameters:
value2 - The second value.

getValue2

public java.lang.Object getValue2()
Gets the second value.

Returns:
the second value.

equals

public boolean equals(java.lang.Object tupleObject)
Determines if two Tuples are equal. Two tuples are equal if the equals methods on both values are both true.

Overrides:
equals in class java.lang.Object
Parameters:
tupleObject - The tuple to compare.
Returns:
True if the tuples are equal or false if not.


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.