Package com.pnfsoftware.jeb.util.base
Class Couple<A,B>
java.lang.Object
com.pnfsoftware.jeb.util.base.Couple<A,B>
- Type Parameters:
A- the first elementB- the second element
Handy class holding two typed elements. Null values are allowed.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetFirst()static <A,B> Collection <A> getFirstElements(Collection<Couple<A, B>> couples) Extract the first element of each pair.static <A,B> Collection <B> getSecondElements(Collection<Couple<A, B>> couples) Extract the second element of each pair.inthashCode()voidvoidtoString()
-
Constructor Details
-
Couple
Create a pair.- Parameters:
a- first elementb- second element
-
-
Method Details
-
getFirst
- Returns:
- the first element
-
setFirst
- Parameters:
a- first element
-
getSecond
- Returns:
- the second element
-
setSecond
- Parameters:
b- second element
-
hashCode
public int hashCode() -
equals
-
toString
-
getFirstElements
Extract the first element of each pair.- Type Parameters:
A- type of first elementsB- type of second elements- Parameters:
couples- input pairs- Returns:
- first elements, in iteration order
-
getSecondElements
Extract the second element of each pair.- Type Parameters:
A- type of first elementsB- type of second elements- Parameters:
couples- input pairs- Returns:
- second elements, in iteration order
-