Module de.powerstat.validation
Class NTuple2<T1 extends Comparable<T1>,T2 extends Comparable<T2>>
java.lang.Object
de.powerstat.validation.containers.NTuple2<T1,T2>
- Type Parameters:
T1- Type 1T2- Type 2
- All Implemented Interfaces:
Comparable<NTuple2<T1,T2>>
public final class NTuple2<T1 extends Comparable<T1>,T2 extends Comparable<T2>>
extends Object
implements Comparable<NTuple2<T1,T2>>
N-Tuple 2.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompare with another object.booleanIs equal with another object.inthashCode()Calculate hash code.static <T1 extends Comparable<T1>,T2 extends Comparable<T2>>
NTuple2<T1,T2> of(T1 obj1, T2 obj2) NTuple2 factory.t1Value()Returns the first value of this NTuple2 as a T1.t2Value()Returns the second value of this NTuple2 as a T2.toString()Returns the string representation of this NTuple2.
-
Field Details
-
object1
Object1 of type T1. -
object2
Object2 of type T2.
-
-
Constructor Details
-
NTuple2
Private constructor.- Parameters:
obj1- Object 1 of type T1obj2- Object 2 of Type T2
-
-
Method Details
-
of
public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>> NTuple2<T1,T2> of(T1 obj1, T2 obj2) NTuple2 factory.- Type Parameters:
T1- Type 1T2- Type 2- Parameters:
obj1- Object 1 of type T1obj2- Object 2 of Type T2- Returns:
- NTuple2 object
-
t1Value
Returns the first value of this NTuple2 as a T1.- Returns:
- The T1 value represented by this object.
-
t2Value
Returns the second value of this NTuple2 as a T2.- Returns:
- The T2 value represented by this object.
-
hashCode
public int hashCode()Calculate hash code. -
equals
Is equal with another object. -
toString
Returns the string representation of this NTuple2. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "NTuple2[object1=..., object2=...]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<T1 extends Comparable<T1>>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-