Package at.jku.ssw.fp.util
Class Tuple2<A,B>
- java.lang.Object
-
- at.jku.ssw.fp.util.Tuple2<A,B>
-
- Type Parameters:
A
- the type of the first valueB
- the type of the second value
- All Implemented Interfaces:
Serializable
public class Tuple2<A,B> extends Object implements Serializable
Tuple of two generic values.- Author:
- Herbert Praehofer
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares this tuple object and the other object for equality.int
hashCode()
Computes a hash code from the hash codes of the two values.static <A,B>
Tuple2<A,B>of(A v1, B v2)
Creates a tuple of two value.String
toString()
Returns a string representation.
-
-
-
Method Detail
-
of
public static <A,B> Tuple2<A,B> of(A v1, B v2)
Creates a tuple of two value.- Type Parameters:
A
- the type of the first valueB
- the type of the second value- Parameters:
v1
- the first valuev2
- the second value- Returns:
- the tuple of first and second value
-
hashCode
public int hashCode()
Computes a hash code from the hash codes of the two values.
-
equals
public boolean equals(Object obj)
Compares this tuple object and the other object for equality. They are equal if the second object is a Tuple2 and the two values are equal.
-
-