|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.osm.YAACEnumMap
public final class YAACEnumMap
This class implements a fast access map keyed by the values of a particular enumeration.
Constructor Summary | |
---|---|
YAACEnumMap()
Create an empty YAACEnumMap for the specified key enumeration. |
|
YAACEnumMap(YAACEnumMap m)
Create a YAACEnumMap that is a deep copy of another YAACEnumMap. |
Method Summary | |
---|---|
void |
clear()
Removes all of the mappings from this map. |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsKey(OSMLayerEnum 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<java.util.Map.Entry<OSMLayerEnum,java.lang.Object>> |
entrySet()
Returns a Set view of the mappings contained in this map. |
java.lang.Object |
get(java.lang.Object key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. |
java.lang.Object |
get(OSMLayerEnum key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. |
boolean |
hasNext()
Returns true if the YAACEnumMap has more elements. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
java.util.Iterator<OSMLayerEnum> |
iterator()
Returns an iterator over a set of elements of type K. |
void |
justPut(OSMLayerEnum key,
java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation). |
void |
justRemove(OSMLayerEnum key)
Removes the mapping for a key from this map if it is present (optional operation). |
java.util.Set<OSMLayerEnum> |
keySet()
Returns a Set view of the keys contained in this map. |
OSMLayerEnum |
next()
Returns the next element in the iteration. |
java.lang.Object |
put(OSMLayerEnum key,
java.lang.Object value)
Associates the specified value with the specified key in this map (optional operation). |
void |
putAll(java.util.Map<? extends OSMLayerEnum,?> m)
Copies all of the mappings from the specified map to this map (optional operation). |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for a key from this map if it is present (optional operation). |
int |
size()
Returns the number of key-value mappings in this map. |
java.lang.String |
toString()
Returns a string representation of this map. |
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, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public YAACEnumMap()
public YAACEnumMap(YAACEnumMap m)
m
- YAACEnumMap to cloneMethod Detail |
---|
public int size()
size
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
public boolean isEmpty()
isEmpty
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
key
- key whose presence in this map is to be tested
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional)
java.lang.NullPointerException
- if the specified key is null and this map
does not permit null keys (optional)public boolean containsKey(OSMLayerEnum key)
key
- key whose presence in this map is to be tested
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional)
java.lang.NullPointerException
- if the specified key is null and this map
does not permit null keys (optional)public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
value
- value whose presence in this map is to be tested
java.lang.ClassCastException
- if the value is of an inappropriate type for
this map (optional)
java.lang.NullPointerException
- if the specified value is null and this
map does not permit null values (optional)public java.lang.Object get(java.lang.Object key)
null
if this map contains no mapping for the key.
More formally, if this map contains a mapping from a key
k
to a value v
such that (key==null ? k==null :
key.equals(k))
, then this method returns v
; otherwise
it returns null
. (There can be at most one such mapping.)
If this map permits null values, then a return value of
null
does not necessarily indicate that the map
contains no mapping for the key; it's also possible that the map
explicitly maps the key to null
. The containsKey
operation may be used to distinguish these two cases.
get
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
key
- the key whose associated value is to be returned
null
if this map contains no mapping for the key
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map (optional)
java.lang.NullPointerException
- if the specified key is null and this map
does not permit null keyspublic java.lang.Object get(OSMLayerEnum key)
null
if this map contains no mapping for the key.
More formally, if this map contains a mapping from a key
k
to a value v
such that (key==null ? k==null :
key.equals(k))
, then this method returns v
; otherwise
it returns null
. (There can be at most one such mapping.)
If this map permits null values, then a return value of
null
does not necessarily indicate that the map
contains no mapping for the key; it's also possible that the map
explicitly maps the key to null
. The containsKey
operation may be used to distinguish these two cases.
key
- the key whose associated value is to be returned
null
if this map contains no mapping for the key
java.lang.NullPointerException
- if the specified key is null and this map
does not permit null keyspublic java.lang.Object put(OSMLayerEnum key, java.lang.Object value)
m.containsKey(k)
would return
true.)
put
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
java.lang.NullPointerException
- if the specified key or value is null
and this map does not permit null keys or valuespublic final void justPut(OSMLayerEnum key, java.lang.Object value)
m.containsKey(k)
would return
true.)
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key
java.lang.NullPointerException
- if the specified key is null
(this map does not permit null keys or values)public java.lang.Object remove(java.lang.Object key)
(key==null ? k==null : key.equals(k))
, that mapping
is removed. (The map can contain at most one such mapping.)
Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.
The map will not contain a mapping for the specified key once the call returns.
remove
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
key
- key whose mapping is to be removed from the map
java.lang.ClassCastException
- if the key is of an inappropriate type for
this map
java.lang.NullPointerException
- if the specified key is null and this
map does not permit null keyspublic void justRemove(OSMLayerEnum key)
(key==null ? k==null : key.equals(k))
, that mapping
is removed. (The map can contain at most one such mapping.)
The map will not contain a mapping for the specified key once the call returns.
key
- key whose mapping is to be removed from the map
java.lang.NullPointerException
- if the specified key is null and this
map does not permit null keys (optional)public void putAll(java.util.Map<? extends OSMLayerEnum,?> m)
put(k, v)
on this map once
for each mapping from key k to value v in the
specified map. The behavior of this operation is undefined if the
specified map is modified while the operation is in progress.
putAll
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
m
- mappings to be stored in this map
java.lang.ClassCastException
- if the class of a key or value in the
specified map prevents it from being stored in this map
java.lang.NullPointerException
- if the specified map is null, or if
this map does not permit null keys or values, and the
specified map contains null keys or values
java.lang.IllegalArgumentException
- if some property of a key or value in
the specified map prevents it from being stored in this mappublic void clear()
clear
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
public java.util.Set<OSMLayerEnum> keySet()
Set
view of the keys contained in this map.
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 (except through
the iterator's own remove operation), 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.
keySet
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
public java.util.Collection values()
Collection
view of the values contained in this map.
The collection is backed by the map, so changes to the map are
reflected in the collection, and vice-versa. If the map is
modified while an iteration over the collection is in progress
(except through the iterator's own remove operation),
the results of the iteration are undefined. The collection
supports element removal, which removes the corresponding
mapping from the map, via the Iterator.remove,
Collection.remove, removeAll,
retainAll and clear operations. It does not
support the add or addAll operations.
values
in interface java.util.Map<OSMLayerEnum,java.lang.Object>
public java.util.Set<java.util.Map.Entry<OSMLayerEnum,java.lang.Object>> entrySet()
Set
view of the mappings contained in this map.
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 (except through
the iterator's own remove operation, or through the
setValue operation on a map entry returned by the
iterator) 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<OSMLayerEnum,java.lang.Object>
public java.lang.String toString()
String.valueOf(Object)
.
toString
in class java.lang.Object
public java.util.Iterator<OSMLayerEnum> iterator()
iterator
in interface java.lang.Iterable<OSMLayerEnum>
public boolean hasNext()
hasNext
in interface java.util.Iterator<OSMLayerEnum>
public OSMLayerEnum next()
next
in interface java.util.Iterator<OSMLayerEnum>
java.util.NoSuchElementException
- iteration has no more elements.public void remove()
remove
in interface java.util.Iterator<OSMLayerEnum>
java.lang.IllegalStateException
- if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
method.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |