Code example for SortedMap

Methods: comparator

0
        this.map = map;
    } 
 
    @Override 
    public Comparator<? super K> comparator() {
        return map.comparator();
    } 
 
    @Override 
    public SortedSet<K> subSet(K fromElement, K toElement) {
        return new SortedMapSetView<>(map.subMap(fromElement, toElement));
    } 
 
    @Override 
    public SortedSet<K> headSet(K toElement) {
        return new SortedMapSetView<>(map.headMap(toElement));
    } 
 
    @Override 
    public SortedSet<K> tailSet(K fromElement) {
        return new SortedMapSetView<>(map.tailMap(fromElement));