lv.gotika.engine.util
Class Quadruple<A,B,C,D>

java.lang.Object
  extended by lv.gotika.engine.util.Quadruple<A,B,C,D>

public class Quadruple<A,B,C,D>
extends Object

Data structure: an ordered 4-tuple consisting of generic objects.


Constructor Summary
Quadruple(A first, B second, C third, D fourth)
          Standard constructor.
 
Method Summary
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 A getFirst()
          Returns the first element of the 4-tuple.
 D getFourth()
          Returns the fourth element of the 4-tuple.
 B getSecond()
          Returns the second element of the 4-tuple.
 C getThird()
          Returns the third element of the 4-tuple.
 int hashCode()
          Returns a hash code value for the 4-tuple (depends on the four elements).
 String toString()
          Returns a string representation of the 4-tuple (concatenation of the four elements).
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Quadruple

public Quadruple(A first,
                 B second,
                 C third,
                 D fourth)
Standard constructor.

Parameters:
first - the first element of the 4-tuple.
second - the second element of the 4-tuple.
third - the third element of the 4-tuple.
fourth - the fourth element of the 4-tuple.
Method Detail

getFirst

public A getFirst()
Returns the first element of the 4-tuple.

Returns:
reference to the first element.

getSecond

public B getSecond()
Returns the second element of the 4-tuple.

Returns:
reference to the second element.

getThird

public C getThird()
Returns the third element of the 4-tuple.

Returns:
reference to the third element.

getFourth

public D getFourth()
Returns the fourth element of the 4-tuple.

Returns:
reference to the fourth element.

toString

public String toString()
Returns a string representation of the 4-tuple (concatenation of the four elements).

Overrides:
toString in class Object
Returns:
a string representation of this object.

hashCode

public int hashCode()
Returns a hash code value for the 4-tuple (depends on the four elements).

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
equals(Object)

equals

public boolean equals(Object o)
Indicates whether some other object is "equal to" this one. Two quadruples are equal if their respective elements are equal.

Overrides:
equals in class Object
Parameters:
o - the reference object with which to compare.
Returns:
true if this object is the same as the argument o; false otherwise.
See Also:
hashCode()