|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.util.ImmutableSortedMap
public class ImmutableSortedMap
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
protected java.util.SortedMap |
map
|
Constructor Summary | |
---|---|
ImmutableSortedMap(java.util.SortedMap map)
Constructor which takes an existing map |
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map (optional operation). |
java.util.Comparator |
comparator()
Returns the comparator associated with this sorted map, or null if it uses its keys' natural ordering. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(java.lang.Object value)
Returns true if this map maps one or more keys to the specified value. |
java.util.Set |
entrySet()
Returns a set view of the mappings contained in this map. |
java.lang.Object |
firstKey()
Returns the first (lowest) key currently in this sorted map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which this map maps the specified key. |
java.util.SortedMap |
headMap(java.lang.Object toKey)
Returns a view of the portion of this sorted map whose keys are strictly less than toKey. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
java.util.Set |
keySet()
Returns a set view of the keys contained in this map. |
java.lang.Object |
lastKey()
Returns the last (highest) key currently in this sorted map. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(java.util.Map t)
Copies all of the mappings from the specified map to this map (optional operation). |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present (optional operation). |
int |
size()
Returns the number of key-value mappings in this map. |
java.util.SortedMap |
subMap(java.lang.Object fromKey,
java.lang.Object toKey)
Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive. |
java.util.SortedMap |
tailMap(java.lang.Object fromKey)
Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey. |
java.util.Collection |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected java.util.SortedMap map
Constructor Detail |
---|
public ImmutableSortedMap(java.util.SortedMap map)
map
- the existing mapMethod Detail |
---|
public java.util.Comparator comparator()
comparator
in interface java.util.SortedMap
public java.util.SortedMap subMap(java.lang.Object fromKey, java.lang.Object toKey)
subMap
in interface java.util.SortedMap
fromKey
- low endpoint (inclusive) of the subMap.toKey
- high endpoint (exclusive) of the subMap.
public java.util.SortedMap headMap(java.lang.Object toKey)
headMap
in interface java.util.SortedMap
toKey
- high endpoint (exclusive) of the subMap.
public java.util.SortedMap tailMap(java.lang.Object fromKey)
tailMap
in interface java.util.SortedMap
fromKey
- low endpoint (inclusive) of the tailMap.
public java.lang.Object firstKey()
firstKey
in interface java.util.SortedMap
java.util.NoSuchElementException
- if this map is empty.public java.lang.Object lastKey()
lastKey
in interface java.util.SortedMap
java.util.NoSuchElementException
- if this map is empty.public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
key
- key whose presence in this map is to be tested.
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
value
- value whose presence in this map is to be tested.
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
key
- key whose associated value is to be returned.
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
java.lang.UnsupportedOperationException
- if the put operation is
not supported by this map.public java.lang.Object remove(java.lang.Object key)
(key==null ? k==null : key.equals(k))
, that mapping
is removed.
remove
in interface java.util.Map
key
- key whose mapping is to be removed from the map.
public void putAll(java.util.Map t)
putAll
in interface java.util.Map
t
- Mappings to be stored in this map.public void clear()
clear
in interface java.util.Map
java.lang.UnsupportedOperationException
- clear is not supported by this
map.public java.util.Set keySet()
keySet
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public java.util.Set entrySet()
Map.Entry
. The set is backed by the
map, so changes to the map are reflected in the set, and vice-versa.
If the map is modified while an iteration over the set is in progress,
the results of the iteration are undefined. The set supports element
removal, which removes the corresponding mapping from the map, via the
Iterator.remove, Set.remove, removeAll,
retainAll and clear operations. It does not support
the add or addAll operations.
entrySet
in interface java.util.Map
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |