|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.util.CmsPair<A,B>
A
- type of the first component of the pairB
- type of the second component of the pairpublic class CmsPair<A,B>
Generic pair class.
Constructor Summary | |
---|---|
CmsPair()
Serialization constructor. |
|
CmsPair(A a,
B b)
Creates a new pair containing two objects. |
Method Summary | ||
---|---|---|
static
|
create(A a,
B b)
Helper method for constructing a pair which avoids having to explicitly write the generic type parameters. |
|
boolean |
equals(Object o)
|
|
A |
getFirst()
Returns the first component of the pair. |
|
static
|
getLexicalComparator()
Utility method which creates a new comparator for lexically ordering pairs. |
|
B |
getSecond()
Returns the second component of the pair. |
|
int |
hashCode()
|
|
static Map<String,String> |
pairsToMap(List<CmsPair<String,String>> pairs)
Helper method for converting a list of string pairs to a string map. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsPair()
public CmsPair(A a, B b)
a
- the first componentb
- the second componentMethod Detail |
---|
public static <A,B> CmsPair<A,B> create(A a, B b)
A
- the type for the first componentB
- the type for the second componenta
- the first componentb
- the second component
public static <A extends Comparable<A>,B extends Comparable<B>> Comparator<CmsPair<A,B>> getLexicalComparator()
Lexical ordering means that a pair is considered "less" than another if either its first component is less than that of the other one, or their first components are equal and the second component of the first pair is less than that of the other one.
A
- the type parameter for the first pair componentB
- the type parameter for the second pair component
public static Map<String,String> pairsToMap(List<CmsPair<String,String>> pairs)
The first component of each pair is used as a map key, the second component as the value for the key.
pairs
- the list of pairs
public boolean equals(Object o)
equals
in class Object
Object.equals(java.lang.Object)
public A getFirst()
public B getSecond()
public int hashCode()
hashCode
in class Object
Object.hashCode()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |