|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.util.Pair<L,R>
public class Pair<L,R>
Pair of values.
Because a pair implements equals(Object), hashCode() and
compareTo(Pair), it can be used in any kind of
Collection.
| Field Summary | |
|---|---|
L |
left
|
R |
right
|
| Constructor Summary | |
|---|---|
Pair(L left,
R right)
Creates a pair. |
|
Pair(Map.Entry<? extends L,? extends R> entry)
Creates a pair representing the same mapping as the specified entry. |
|
| Method Summary | ||
|---|---|---|
int |
compareTo(Pair<L,R> that)
|
|
boolean |
equals(Object obj)
|
|
L |
getKey()
|
|
R |
getValue()
|
|
int |
hashCode()
|
|
static
|
leftIter(Iterable<Pair<L,R>> iterable)
Returns an iterable over the left slice of an iterable. |
|
static
|
of(L left,
R right)
Creates a Pair. |
|
static
|
rightIter(Iterable<Pair<L,R>> iterable)
Returns an iterable over the right slice of an iterable. |
|
R |
setValue(R value)
|
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public L left
public R right
| Constructor Detail |
|---|
public Pair(L left,
R right)
left - Left valueright - Right valuepublic Pair(Map.Entry<? extends L,? extends R> entry)
entry - the entry to copy| Method Detail |
|---|
public static <L,R> Pair<L,R> of(L left,
R right)
left - Left valueright - Right value
public boolean equals(Object obj)
equals in interface Map.Entry<L,R>equals in class Objectpublic int hashCode()
hashCode in interface Map.Entry<L,R>hashCode in class Objectpublic int compareTo(Pair<L,R> that)
compareTo in interface Comparable<Pair<L,R>>public String toString()
toString in class Objectpublic L getKey()
getKey in interface Map.Entry<L,R>public R getValue()
getValue in interface Map.Entry<L,R>public R setValue(R value)
setValue in interface Map.Entry<L,R>public static <L,R> Iterable<L> leftIter(Iterable<Pair<L,R>> iterable)
L - Left typeR - Right typeiterable - Iterable over pairs
public static <L,R> Iterable<R> rightIter(Iterable<Pair<L,R>> iterable)
L - right typeR - Right typeiterable - Iterable over pairs
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||