FileDocCategorySizeDatePackage
SortedMap.javaAPI DocAndroid 1.5 API5400Wed May 06 22:41:04 BST 2009java.util

SortedMap

public interface SortedMap implements Map
A map that has its keys ordered. The sorting is according to either the natural ordering of its keys or the ordering given by a specified comparator.
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public java.util.Comparatorcomparator()
Returns the comparator used to compare keys in this sorted map.

return
the comparator or {@code null} if the natural order is used.
since
Android 1.0

public KfirstKey()
Returns the first key in this sorted map.

return
the first key in this sorted map.
exception
NoSuchElementException if this sorted map is empty.
since
Android 1.0

public java.util.SortedMapheadMap(K endKey)
Returns a sorted map over a range of this sorted map with all keys that are less than the specified {@code endKey}. Changes to the returned sorted map are reflected in this sorted map and vice versa.

Note: The returned map will not allow an insertion of a key outside the specified range.

param
endKey the high boundary of the range specified.
return
a sorted map where the keys are less than {@code endKey}.
throws
ClassCastException if the class of the end key is inappropriate for this sorted map.
throws
NullPointerException if the end key is {@code null} and this sorted map does not support {@code null} keys.
throws
IllegalArgumentException if this map is itself a sorted map over a range of another map and the specified key is outside of its range.
since
Android 1.0

public KlastKey()
Returns the last key in this sorted map.

return
the last key in this sorted map.
exception
NoSuchElementException if this sorted map is empty.
since
Android 1.0

public java.util.SortedMapsubMap(K startKey, K endKey)
Returns a sorted map over a range of this sorted map with all keys greater than or equal to the specified {@code startKey} and less than the specified {@code endKey}. Changes to the returned sorted map are reflected in this sorted map and vice versa.

Note: The returned map will not allow an insertion of a key outside the specified range.

param
startKey the low boundary of the range (inclusive).
param
endKey the high boundary of the range (exclusive),
return
a sorted map with the key from the specified range.
throws
ClassCastException if the class of the start or end key is inappropriate for this sorted map.
throws
NullPointerException if the start or end key is {@code null} and this sorted map does not support {@code null} keys.
throws
IllegalArgumentException if the start key is greater than the end key, or if this map is itself a sorted map over a range of another sorted map and the specified range is outside of its range.
since
Android 1.0

public java.util.SortedMaptailMap(K startKey)
Returns a sorted map over a range of this sorted map with all keys that are greater than or equal to the specified {@code startKey}. Changes to the returned sorted map are reflected in this sorted map and vice versa.

Note: The returned map will not allow an insertion of a key outside the specified range.

param
startKey the low boundary of the range specified.
return
a sorted map where the keys are greater or equal to {@code startKey}.
throws
ClassCastException if the class of the start key is inappropriate for this sorted map.
throws
NullPointerException if the start key is {@code null} and this sorted map does not support {@code null} keys.
throws
IllegalArgumentException if this map itself a sorted map over a range of another map and the specified key is outside of its range.
since
Android 1.0