|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.core.util.Pair<F,S>
F
- type of first contained objectS
- type of second contained objectpublic class Pair<F,S>
A simple pair implementation.
Nested Class Summary | |
---|---|
static class |
Pair.FirstComparator<F extends Comparable<F>,S>
Comparator that uses the first element as base. |
static class |
Pair.SecondComparator<F,S extends Comparable<S>>
Comparator that uses the second element as base. |
Constructor Summary | |
---|---|
Pair()
Constructs a pair with null elements. |
|
Pair(F thefirst,
S thesecond)
Constructs a pair given both elements. |
|
Pair(Map.Entry<F,S> entry)
Constructs a pair from a map entry. |
Method Summary | ||
---|---|---|
boolean |
equals(Object obj)
|
|
static
|
fromMap(Map<G,T> map)
Constructs a list of pairs from the entries of a map. |
|
F |
getFirst()
Returns the first element. |
|
S |
getSecond()
Returns the second element. |
|
int |
hashCode()
|
|
void |
setFirst(F thefirst)
Sets the first element. |
|
void |
setSecond(S thesecond)
Sets the second element. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Pair()
null
elements.
public Pair(F thefirst, S thesecond)
thefirst
- the first elementthesecond
- the second elementpublic Pair(Map.Entry<F,S> entry)
entry
- an entry of a mapMethod Detail |
---|
public static <G,T> List<Pair<G,T>> fromMap(Map<G,T> map)
G
- type of the map keysT
- type of the map valuesmap
- a map
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public void setFirst(F thefirst)
thefirst
- the first element to setpublic F getFirst()
public void setSecond(S thesecond)
thesecond
- the second element to setpublic S getSecond()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |