src/share/classes/java/util/TreeMap.java

Print this page
rev 7485 : 8009736: Comparator API cleanup
Reviewed-by:
Contributed-by: henry.jen@oracle.com


2927                 throw new NullPointerException();
2928             if (est < 0)
2929                 getEstimate(); // force initialization
2930             if ((e = current) == null || e == fence)
2931                 return false;
2932             current = successor(e);
2933             action.accept(e);
2934             if (tree.modCount != expectedModCount)
2935                 throw new ConcurrentModificationException();
2936             return true;
2937         }
2938 
2939         public int characteristics() {
2940             return (side == 0 ? Spliterator.SIZED : 0) |
2941                    Spliterator.DISTINCT | Spliterator.SORTED | Spliterator.ORDERED;
2942         }
2943 
2944         @Override
2945         public Comparator<? super Map.Entry<K, V>> getComparator() {
2946             return tree.comparator != null ?
2947                    Comparators.byKey(tree.comparator) : null;
2948         }
2949     }
2950 }


2927                 throw new NullPointerException();
2928             if (est < 0)
2929                 getEstimate(); // force initialization
2930             if ((e = current) == null || e == fence)
2931                 return false;
2932             current = successor(e);
2933             action.accept(e);
2934             if (tree.modCount != expectedModCount)
2935                 throw new ConcurrentModificationException();
2936             return true;
2937         }
2938 
2939         public int characteristics() {
2940             return (side == 0 ? Spliterator.SIZED : 0) |
2941                     Spliterator.DISTINCT | Spliterator.SORTED | Spliterator.ORDERED;
2942         }
2943 
2944         @Override
2945         public Comparator<? super Map.Entry<K, V>> getComparator() {
2946             return tree.comparator != null ?
2947                     Map.Entry.comparingByKey(tree.comparator) : null;
2948         }
2949     }
2950 }