|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.util.Pairs
public final class Pairs
Utility class that provides methods for easy manipulation of Lists
of Pairs.
| Method Summary | ||
|---|---|---|
static
|
identityPairs(E[] values)
Returns a List of Pairs where the two components
the ith element return the value of the ith element of
values. |
|
static
|
identityPairs(List<? extends E> values)
Returns a List of Pairs where the two components
the ith element return the value of the ith element of
values. |
|
static
|
mergePairs(E[] labels,
F[] values)
Returns a List of Pairs where the first component
of the ith element returns the value of the ith element of
labels and the second component of the ith element
returns the value of the ith element of values. |
|
static
|
mergePairs(List<? extends E> labels,
List<? extends F> values)
Returns a List of Pairs where the first component
of the ith element returns the value of the ith element of
labels and the second component of the ith element
returns the value of the ith element of values. |
|
static
|
retainFirst(List<? extends Pair<? extends E,? extends F>> pairs)
Returns a List containing only the first components of the specified
List of Pairs. |
|
static
|
retainSecond(List<? extends Pair<? extends E,? extends F>> pairs)
Returns a List containing only the second components of the specified
List of Pairs. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <E> List<Pair<E,E>> identityPairs(E[] values)
List of Pairs where the two components
the ith element return the value of the ith element of
values.
public static <E> List<Pair<E,E>> identityPairs(List<? extends E> values)
List of Pairs where the two components
the ith element return the value of the ith element of
values.
public static <E,F> List<Pair<E,F>> mergePairs(E[] labels,
F[] values)
List of Pairs where the first component
of the ith element returns the value of the ith element of
labels and the second component of the ith element
returns the value of the ith element of values.
The two arguments must be of equal size.
public static <E,F> List<Pair<E,F>> mergePairs(List<? extends E> labels,
List<? extends F> values)
List of Pairs where the first component
of the ith element returns the value of the ith element of
labels and the second component of the ith element
returns the value of the ith element of values.
The two arguments must be of equal size.
public static <E,F> List<E> retainFirst(List<? extends Pair<? extends E,? extends F>> pairs)
List containing only the first components of the specified
List of Pairs.
public static <E,F> List<F> retainSecond(List<? extends Pair<? extends E,? extends F>> pairs)
List containing only the second components of the specified
List of Pairs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||