Code example for SortedMap

Methods: headMap

0
 
  private class SortedMapBasedElementSet extends MapBasedElementSet 
      implements SortedSet<E> {
 
    SortedMapBasedElementSet(SortedMap<E, AtomicInteger> map) {
      super(map);
    } 
 
    SortedMap<E, AtomicInteger> sortedMap() {
      return (SortedMap<E, AtomicInteger>) getMap();
    } 
 
    public Comparator<? super E> comparator() {
      return sortedMap().comparator();
    } 
 
    public E first() { 
      return sortedMap().firstKey();
    } 
 
    public E last() { 
      return sortedMap().lastKey();
    } 
 
    public SortedSet<E> headSet(E toElement) {
      return new SortedMapBasedElementSet(sortedMap().headMap(toElement));
    } 
 
    public SortedSet<E> subSet(E fromElement, E toElement) {
      return new SortedMapBasedElementSet( 
          sortedMap().subMap(fromElement, toElement));
Contextual code suggestions in your IDE  Get Codota for Java