Package mondrian.util
Class Pair<L,R>
java.lang.Object
mondrian.util.Pair<L,R>
- All Implemented Interfaces:
Comparable<Pair<L,
,R>> Map.Entry<L,
R>
- Direct Known Subclasses:
SchemaKey
Pair of values.
Because a pair implements equals(Object)
, hashCode()
and
compareTo(Pair)
, it can be used in any kind of
Collection
.
- Since:
- Apr 19, 2007
- Author:
- jhyde
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
getKey()
getValue()
int
hashCode()
static <L,
R> List<L> Returns a list of the left elements of a list of pairs.static <L,
R> Iterable<L> Returns an iterable over the left slice of an iterable.static <L,
R> Pair<L, R> of
(L left, R right) Creates a Pair.static <L,
R> List<R> Returns a list of the right elements of a list of pairs.static <L,
R> Iterable<R> Returns an iterable over the right slice of an iterable.toString()
-
Field Details
-
left
-
right
-
-
Constructor Details
-
Pair
Creates a pair.- Parameters:
left
- Left valueright
- Right value
-
Pair
Creates a pair representing the same mapping as the specified entry.- Parameters:
entry
- the entry to copy
-
-
Method Details
-
of
Creates a Pair.- Parameters:
left
- Left valueright
- Right value- Returns:
- a new Pair
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<L>
-
toString
-
getKey
-
getValue
-
setValue
-
leftIter
Returns an iterable over the left slice of an iterable.- Type Parameters:
L
- Left typeR
- Right type- Parameters:
iterable
- Iterable over pairs- Returns:
- Iterable over the left elements
-
rightIter
Returns an iterable over the right slice of an iterable.- Type Parameters:
L
- right typeR
- Right type- Parameters:
iterable
- Iterable over pairs- Returns:
- Iterable over the right elements
-
left
Returns a list of the left elements of a list of pairs. -
right
Returns a list of the right elements of a list of pairs.
-