|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.molae.pipe.sorted.KeyComparator<K>
public final class KeyComparator<K>
Applies a comparator to the key of map entries.
Constructor Summary | |
---|---|
KeyComparator(Comparator<? super K> base)
Constructs a KeyComparator object. |
Method Summary | |
---|---|
int |
compare(Map.Entry<K,?> o1,
Map.Entry<K,?> o2)
Applies the underlying comparator to the key of the specified map entry. |
boolean |
equals(Object obj)
Compares the specified object with this collection for equality. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyComparator(Comparator<? super K> base)
base
- The comparator to apply to the keys.Method Detail |
---|
public int compare(Map.Entry<K,?> o1, Map.Entry<K,?> o2)
compare
in interface Comparator<Map.Entry<K,?>>
ClassCastException
- if either parameter is not a map
Map.Entry
or if the base comparator cannot compare the keys of
the map entries.
NullPointerException
- if either entry is null
or if either key is null
and the base comparator does
not accept null
values.public boolean equals(Object obj)
true
, iff the parameter is a
KeyComparator
and the base comparators are equal.
equals
in interface Comparator<Map.Entry<K,?>>
equals
in class Object
obj
- the reference object with which to compare.
true
if the specified Object is equal to this
comparator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |