|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.p2p.util.ImmutableSortedMap
public class ImmutableSortedMap
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected SortedMap |
map
|
| Constructor Summary | |
|---|---|
ImmutableSortedMap(SortedMap map)
Constructor which takes an existing map |
|
| Method Summary | |
|---|---|
void |
clear()
Removes all mappings from this map (optional operation). |
Comparator |
comparator()
Returns the comparator associated with this sorted map, or null if it uses its keys' natural ordering. |
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value. |
Set |
entrySet()
Returns a set view of the mappings contained in this map. |
Object |
firstKey()
Returns the first (lowest) key currently in this sorted map. |
Object |
get(Object key)
Returns the value to which this map maps the specified key. |
SortedMap |
headMap(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. |
Set |
keySet()
Returns a set view of the keys contained in this map. |
Object |
lastKey()
Returns the last (highest) key currently in this sorted map. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(Map t)
Copies all of the mappings from the specified map to this map (optional operation). |
Object |
remove(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. |
SortedMap |
subMap(Object fromKey,
Object toKey)
Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive. |
SortedMap |
tailMap(Object fromKey)
Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey. |
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 SortedMap map
| Constructor Detail |
|---|
public ImmutableSortedMap(SortedMap map)
map - the existing map| Method Detail |
|---|
public Comparator comparator()
comparator in interface SortedMap
public SortedMap subMap(Object fromKey,
Object toKey)
subMap in interface SortedMapfromKey - low endpoint (inclusive) of the subMap.toKey - high endpoint (exclusive) of the subMap.
public SortedMap headMap(Object toKey)
headMap in interface SortedMaptoKey - high endpoint (exclusive) of the subMap.
public SortedMap tailMap(Object fromKey)
tailMap in interface SortedMapfromKey - low endpoint (inclusive) of the tailMap.
public Object firstKey()
firstKey in interface SortedMapNoSuchElementException - if this map is empty.public Object lastKey()
lastKey in interface SortedMapNoSuchElementException - if this map is empty.public int size()
size in interface Mappublic boolean isEmpty()
isEmpty in interface Mappublic boolean containsKey(Object key)
containsKey in interface Mapkey - key whose presence in this map is to be tested.
public boolean containsValue(Object value)
containsValue in interface Mapvalue - value whose presence in this map is to be tested.
public Object get(Object key)
get in interface Mapkey - key whose associated value is to be returned.
public Object put(Object key,
Object value)
put in interface Mapkey - key with which the specified value is to be associated.value - value to be associated with the specified key.
UnsupportedOperationException - if the put operation is
not supported by this map.public Object remove(Object key)
(key==null ? k==null : key.equals(k)), that mapping
is removed.
remove in interface Mapkey - key whose mapping is to be removed from the map.
public void putAll(Map t)
putAll in interface Mapt - Mappings to be stored in this map.public void clear()
clear in interface MapUnsupportedOperationException - clear is not supported by this
map.public Set keySet()
keySet in interface MapkeySet in interface SortedMappublic Collection values()
values in interface Mapvalues in interface SortedMappublic 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 MapentrySet in interface SortedMap
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||