ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/TreeMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/TreeMap.java (file contents):
Revision 1.21 by jsr166, Fri Jun 24 00:26:57 2005 UTC vs.
Revision 1.22 by jsr166, Fri Jun 24 20:44:49 2005 UTC

# Line 645 | Line 645 | public class TreeMap<K,V>
645  
646      // NavigableMap API methods
647  
648 +    /**
649 +     * @since 1.6
650 +     */
651      public Map.Entry<K,V> firstEntry() {
652          Entry<K,V> e = getFirstEntry();
653          return (e == null)? null : new AbstractMap.SimpleImmutableEntry<K,V>(e);
654      }
655  
656 +    /**
657 +     * @since 1.6
658 +     */
659      public Map.Entry<K,V> lastEntry() {
660          Entry<K,V> e = getLastEntry();
661          return (e == null)? null : new AbstractMap.SimpleImmutableEntry<K,V>(e);
662      }
663  
664 +    /**
665 +     * @since 1.6
666 +     */
667      public Map.Entry<K,V> pollFirstEntry() {
668          Entry<K,V> p = getFirstEntry();
669          if (p == null)
# Line 664 | Line 673 | public class TreeMap<K,V>
673          return result;
674      }
675  
676 +    /**
677 +     * @since 1.6
678 +     */
679      public Map.Entry<K,V> pollLastEntry() {
680          Entry<K,V> p = getLastEntry();
681          if (p == null)
# Line 678 | Line 690 | public class TreeMap<K,V>
690       * @throws NullPointerException if the specified key is null
691       *         and this map uses natural ordering, or its comparator
692       *         does not permit null keys
693 +     * @since 1.6
694       */
695      public Map.Entry<K,V> lowerEntry(K key) {
696          Entry<K,V> e =  getLowerEntry(key);
# Line 689 | Line 702 | public class TreeMap<K,V>
702       * @throws NullPointerException if the specified key is null
703       *         and this map uses natural ordering, or its comparator
704       *         does not permit null keys
705 +     * @since 1.6
706       */
707      public K lowerKey(K key) {
708          Entry<K,V> e =  getLowerEntry(key);
# Line 700 | Line 714 | public class TreeMap<K,V>
714       * @throws NullPointerException if the specified key is null
715       *         and this map uses natural ordering, or its comparator
716       *         does not permit null keys
717 +     * @since 1.6
718       */
719      public Map.Entry<K,V> floorEntry(K key) {
720          Entry<K,V> e = getFloorEntry(key);
# Line 711 | Line 726 | public class TreeMap<K,V>
726       * @throws NullPointerException if the specified key is null
727       *         and this map uses natural ordering, or its comparator
728       *         does not permit null keys
729 +     * @since 1.6
730       */
731      public K floorKey(K key) {
732          Entry<K,V> e = getFloorEntry(key);
# Line 722 | Line 738 | public class TreeMap<K,V>
738       * @throws NullPointerException if the specified key is null
739       *         and this map uses natural ordering, or its comparator
740       *         does not permit null keys
741 +     * @since 1.6
742       */
743      public Map.Entry<K,V> ceilingEntry(K key) {
744          Entry<K,V> e = getCeilingEntry(key);
# Line 733 | Line 750 | public class TreeMap<K,V>
750       * @throws NullPointerException if the specified key is null
751       *         and this map uses natural ordering, or its comparator
752       *         does not permit null keys
753 +     * @since 1.6
754       */
755      public K ceilingKey(K key) {
756          Entry<K,V> e = getCeilingEntry(key);
# Line 744 | Line 762 | public class TreeMap<K,V>
762       * @throws NullPointerException if the specified key is null
763       *         and this map uses natural ordering, or its comparator
764       *         does not permit null keys
765 +     * @since 1.6
766       */
767      public Map.Entry<K,V> higherEntry(K key) {
768          Entry<K,V> e = getHigherEntry(key);
# Line 755 | Line 774 | public class TreeMap<K,V>
774       * @throws NullPointerException if the specified key is null
775       *         and this map uses natural ordering, or its comparator
776       *         does not permit null keys
777 +     * @since 1.6
778       */
779      public K higherKey(K key) {
780          Entry<K,V> e = getHigherEntry(key);
# Line 922 | Line 942 | public class TreeMap<K,V>
942          }
943      }
944  
945 +    /**
946 +     * @since 1.6
947 +     */
948      public Set<Map.Entry<K,V>> descendingEntrySet() {
949          Set<Map.Entry<K,V>> es = descendingEntrySet;
950          return (es != null) ? es : (descendingEntrySet = new DescendingEntrySet());
# Line 933 | Line 956 | public class TreeMap<K,V>
956          }
957      }
958  
959 +    /**
960 +     * @since 1.6
961 +     */
962      public Set<K> descendingKeySet() {
963          Set<K> ks = descendingKeySet;
964          return (ks != null) ? ks : (descendingKeySet = new DescendingKeySet());
# Line 950 | Line 976 | public class TreeMap<K,V>
976       *         null and this map uses natural ordering, or its comparator
977       *         does not permit null keys
978       * @throws IllegalArgumentException {@inheritDoc}
979 +     * @since 1.6
980       */
981      public NavigableMap<K,V> navigableSubMap(K fromKey, K toKey) {
982          return new SubMap(fromKey, toKey);
# Line 961 | Line 988 | public class TreeMap<K,V>
988       *         and this map uses natural ordering, or its comparator
989       *         does not permit null keys
990       * @throws IllegalArgumentException {@inheritDoc}
991 +     * @since 1.6
992       */
993      public NavigableMap<K,V> navigableHeadMap(K toKey) {
994          return new SubMap(toKey, true);
# Line 972 | Line 1000 | public class TreeMap<K,V>
1000       *         and this map uses natural ordering, or its comparator
1001       *         does not permit null keys
1002       * @throws IllegalArgumentException {@inheritDoc}
1003 +     * @since 1.6
1004       */
1005      public NavigableMap<K,V> navigableTailMap(K fromKey) {
1006          return new SubMap(fromKey, false);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines