edu.umd.cfar.lamp.viper.util
Class Triple

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.Pair
      extended byedu.umd.cfar.lamp.viper.util.Triple
All Implemented Interfaces:
java.io.Serializable

public class Triple
extends Pair

An ordered set of three objects. It is sort-of-immutable, in that its reference elements cannot be switched with other elements.

See Also:
Serialized Form

Constructor Summary
Triple(java.lang.Object first, java.lang.Object second, java.lang.Object third)
          Constructs a new triple with the given objects.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the elements of the triple with the elements of the target triple.
 java.lang.Object getThird()
          Gets a reference to the third element.
 int hashCode()
          The xor of the three elements of this.
 java.lang.String toString()
          Uses the toString method to concatenate the elements together in a space-seperated list.
 
Methods inherited from class edu.umd.cfar.lamp.viper.util.Pair
getFirst, getSecond
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Triple

public Triple(java.lang.Object first,
              java.lang.Object second,
              java.lang.Object third)
Constructs a new triple with the given objects.

Parameters:
first - the first element
second - the second element
third - the third, final element
Method Detail

toString

public java.lang.String toString()
Uses the toString method to concatenate the elements together in a space-seperated list. Note, it currently doesn't encode the spaces, which would be necessary to make the output parseable, and nulls would probably have to be different, somehow.

Overrides:
toString in class Pair
Returns:
the elements toString versions, concatenated.

getThird

public java.lang.Object getThird()
Gets a reference to the third element.

Returns:
reference to the third element

equals

public boolean equals(java.lang.Object o)
Compares the elements of the triple with the elements of the target triple.

Overrides:
equals in class Pair
Parameters:
o - the object to compare with
Returns:
true if all the elements of each are equal

hashCode

public int hashCode()
The xor of the three elements of this.

Overrides:
hashCode in class Pair
Returns:
first.hash ^ second.hash, basically
See Also:
Pair.hashCode()