mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Add static Map.Entry methods (#530)
This commit is contained in:
parent
55ba9be16a
commit
e95092fd43
|
@ -28,6 +28,22 @@ public interface TMap<K, V> {
|
|||
V1 getValue();
|
||||
|
||||
V1 setValue(V1 value);
|
||||
|
||||
static <K extends Comparable<? super K>, V> TComparator<TMap.Entry<K, V>> comparingByKey() {
|
||||
return (a, b) -> a.getKey().compareTo(b.getKey());
|
||||
}
|
||||
|
||||
static <K, V extends Comparable<? super V>> TComparator<TMap.Entry<K, V>> comparingByValue() {
|
||||
return (a, b) -> a.getValue().compareTo(b.getValue());
|
||||
}
|
||||
|
||||
static <K, V> TComparator<TMap.Entry<K, V>> comparingByKey(TComparator<? super K> comp) {
|
||||
return (a, b) -> comp.compare(a.getKey(), b.getKey());
|
||||
}
|
||||
|
||||
static <K, V> TComparator<TMap.Entry<K, V>> comparingByValue(TComparator<? super V> comp) {
|
||||
return (a, b) -> comp.compare(a.getValue(), b.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
int size();
|
||||
|
|
Loading…
Reference in New Issue
Block a user