mirror of
https://github.com/corda/corda.git
synced 2025-06-14 05:08:18 +00:00
add minimal NavigableMap interface
This commit is contained in:
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
||||
public class TreeMap<K,V> implements SortedMap<K,V> {
|
||||
public class TreeMap<K,V> implements NavigableMap<K,V> {
|
||||
private final Comparator<K> comparator;
|
||||
private transient TreeSet<MyEntry<K,V>> set;
|
||||
|
||||
@ -50,6 +50,16 @@ public class TreeMap<K,V> implements SortedMap<K,V> {
|
||||
return comparator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map.Entry<K,V> firstEntry() {
|
||||
return set.first();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map.Entry<K,V> lastEntry() {
|
||||
return set.last();
|
||||
}
|
||||
|
||||
@Override
|
||||
public K firstKey() {
|
||||
return set.first().key;
|
||||
|
Reference in New Issue
Block a user