--- jsr166/src/main/java/util/NavigableMap.java 2004/12/28 12:14:07 1.1
+++ jsr166/src/main/java/util/NavigableMap.java 2005/03/22 16:48:32 1.4
@@ -25,7 +25,11 @@ package java.util;
* descendingEntrySet return descending views. The
* performance of ascending traversals is likely to be faster than
* descending traversals. Notice that it is possible to perform
- * subrannge traversals in either direction using SubMap.
+ * subrange traversals in either direction using navigableSubMap.
+ * Methods navigableSubMap, navigableHeadMap, and
+ * navigableTailMap differ from the similarly named
+ * SortedMap methods only in that the returned maps
+ * are guaranteed to obey the NavigableMap interface.
*
*
This interface additionally defines methods firstEntry,
* pollFirstEntry, lastEntry, and
@@ -57,7 +61,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public Map.Entry ceilingEntry(K key);
+ Map.Entry ceilingEntry(K key);
/**
* Returns least key greater than or equal to the given key, or
@@ -71,7 +75,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public K ceilingKey(K key);
+ K ceilingKey(K key);
/**
* Returns a key-value mapping associated with the greatest
@@ -86,7 +90,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public Map.Entry lowerEntry(K key);
+ Map.Entry lowerEntry(K key);
/**
* Returns the greatest key strictly less than the given key, or
@@ -100,7 +104,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public K lowerKey(K key);
+ K lowerKey(K key);
/**
* Returns a key-value mapping associated with the greatest key
@@ -115,7 +119,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public Map.Entry floorEntry(K key);
+ Map.Entry floorEntry(K key);
/**
* Returns the greatest key
@@ -130,7 +134,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public K floorKey(K key);
+ K floorKey(K key);
/**
* Returns a key-value mapping associated with the least key
@@ -145,7 +149,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public Map.Entry higherEntry(K key);
+ Map.Entry higherEntry(K key);
/**
* Returns the least key strictly greater than the given key, or
@@ -159,7 +163,7 @@ public interface NavigableMap exten
* @throws NullPointerException if key is null and this map
* does not support null keys.
*/
- public K higherKey(K key);
+ K higherKey(K key);
/**
* Returns a key-value mapping associated with the least
@@ -168,7 +172,7 @@ public interface NavigableMap exten
* @return an Entry with least key, or null
* if the map is empty.
*/
- public Map.Entry firstEntry();
+ Map.Entry firstEntry();
/**
* Returns a key-value mapping associated with the greatest
@@ -177,7 +181,7 @@ public interface NavigableMap exten
* @return an Entry with greatest key, or null
* if the map is empty.
*/
- public Map.Entry lastEntry();
+ Map.Entry lastEntry();
/**
* Removes and returns a key-value mapping associated with
@@ -186,7 +190,7 @@ public interface NavigableMap exten
* @return the removed first entry of this map, or null
* if the map is empty.
*/
- public Map.Entry pollFirstEntry();
+ Map.Entry pollFirstEntry();
/**
* Removes and returns a key-value mapping associated with
@@ -195,7 +199,7 @@ public interface NavigableMap exten
* @return the removed last entry of this map, or null
* if the map is empty.
*/
- public Map.Entry pollLastEntry();
+ Map.Entry pollLastEntry();
/**
* Returns a set view of the keys contained in this map, in
@@ -237,10 +241,11 @@ public interface NavigableMap exten
/**
* Returns a view of the portion of this map whose keys range from
* fromKey, inclusive, to toKey, exclusive. (If
- * fromKey and toKey are equal, the returned sorted map
- * is empty.) The returned sorted map is backed by this map, so changes
- * in the returned sorted map are reflected in this map, and vice-versa.
-
+ * fromKey and toKey are equal, the returned
+ * navigable map is empty.) The returned navigable map is backed
+ * by this map, so changes in the returned navigable map are
+ * reflected in this map, and vice-versa.
+ *
* @param fromKey low endpoint (inclusive) of the subMap.
* @param toKey high endpoint (exclusive) of the subMap.
*
@@ -257,12 +262,12 @@ public interface NavigableMap exten
* toKey is null and this map does not support
* null keys.
*/
- public NavigableMap subMap(K fromKey, K toKey);
+ NavigableMap navigableSubMap(K fromKey, K toKey);
/**
* Returns a view of the portion of this map whose keys are strictly less
- * than toKey. The returned sorted map is backed by this map, so
- * changes in the returned sorted map are reflected in this map, and
+ * than toKey. The returned navigable map is backed by this map, so
+ * changes in the returned navigable map are reflected in this map, and
* vice-versa.
* @param toKey high endpoint (exclusive) of the headMap.
* @return a view of the portion of this map whose keys are strictly
@@ -274,12 +279,12 @@ public interface NavigableMap exten
* @throws NullPointerException if toKey is null
* and this map does not support null keys.
*/
- public NavigableMap headMap(K toKey);
+ NavigableMap navigableHeadMap(K toKey);
/**
* Returns a view of the portion of this map whose keys are
- * greater than or equal to fromKey. The returned sorted
- * map is backed by this map, so changes in the returned sorted
+ * greater than or equal to fromKey. The returned navigable
+ * map is backed by this map, so changes in the returned navigable
* map are reflected in this map, and vice-versa.
* @param fromKey low endpoint (inclusive) of the tailMap.
* @return a view of the portion of this map whose keys are greater
@@ -290,5 +295,5 @@ public interface NavigableMap exten
* @throws NullPointerException if fromKey is null
* and this map does not support null keys.
*/
- public NavigableMap tailMap(K fromKey);
+ NavigableMap navigableTailMap(K fromKey);
}