|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
com.taco.data.AbstractNoReturnMap
com.taco.data.WrappedKeyValueMap
public class WrappedKeyValueMap
An implementation of Map
that automatically wraps and unwraps
both keys and values.
Nested Class Summary | |
---|---|
protected class |
WrappedKeyValueMap.WrappedEntry
Represents a map entry in the entry set. |
protected class |
WrappedKeyValueMap.WrappedEntryIterator
An iterator over the entry set. |
protected class |
WrappedKeyValueMap.WrappedEntrySet
A class that acts as the entry set of a WrappedKeyValueMap . |
Nested classes/interfaces inherited from class com.taco.data.AbstractNoReturnMap |
---|
AbstractNoReturnMap.NoReturnEntry, AbstractNoReturnMap.NoReturnEntrySet, AbstractNoReturnMap.NoReturnIterator |
Nested classes/interfaces inherited from interface com.taco.data.INoReturnMap |
---|
INoReturnMap.INoReturnEntry |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Field Summary | |
---|---|
protected java.util.Set |
_cachedEntrySet
The entry set, lazily computed, and cached. |
protected java.util.Map |
_innerMap
The map that stores wrapped keys and values. |
protected IObjectMapper |
_keyUnwrapper
The key unwrapper. |
protected IObjectMapper |
_keyWrapper
The key wrapper. |
protected INoReturnMap |
_noReturnMap
If _innerMap is an instance of INoReturnMap ,
this is a casted copy of _innerMap . |
protected IObjectMapper |
_valueUnwrapper
The value unwrapper. |
protected IObjectMapper |
_valueWrapper
The value wrapper. |
Fields inherited from class com.taco.data.AbstractNoReturnMap |
---|
_cachedNoReturnEntrySet |
Constructor Summary | |
---|---|
WrappedKeyValueMap(java.util.Map map,
IObjectMapper keyWrapper,
IObjectMapper keyUnwrapper,
IObjectMapper valueWrapper,
IObjectMapper valueUnwrapper)
Create a new instance that uses the argument map to store wrapped keys and values. |
Method Summary | |
---|---|
void |
clear()
|
java.lang.Object |
clone()
|
java.util.Set |
entrySet()
|
java.util.Set |
entrySetNoReturn()
Wrap the return value of entrySet() to make it an instance
of NoReturnEntrySet , which contains instances of
INoReturnEntry . |
java.lang.Object |
get(java.lang.Object key)
|
boolean |
isEmpty()
|
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putNoReturn(java.lang.Object key,
java.lang.Object value)
This implementation simply calls put() -- there is
no speed advantage to using this method. |
java.lang.Object |
remove(java.lang.Object key)
|
void |
removeNoReturn(java.lang.Object key)
This implementation simply calls remove() -- there is
no speed advantage to using this method. |
int |
size()
|
Methods inherited from class com.taco.data.AbstractNoReturnMap |
---|
putAll |
Methods inherited from class java.util.AbstractMap |
---|
containsKey, containsValue, equals, hashCode, keySet, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, containsValue, equals, hashCode, keySet, values |
Field Detail |
---|
protected java.util.Map _innerMap
protected IObjectMapper _keyWrapper
protected IObjectMapper _keyUnwrapper
protected IObjectMapper _valueWrapper
protected IObjectMapper _valueUnwrapper
protected INoReturnMap _noReturnMap
_innerMap
is an instance of INoReturnMap
,
this is a casted copy of _innerMap
.
protected transient java.util.Set _cachedEntrySet
Constructor Detail |
---|
public WrappedKeyValueMap(java.util.Map map, IObjectMapper keyWrapper, IObjectMapper keyUnwrapper, IObjectMapper valueWrapper, IObjectMapper valueUnwrapper)
map
- The map used to store wrapped keys and values.keyWrapper
- Used to wrap keys. If null
, keys will
not be wrapped.keyUnwrapper
- Used to unwrap keys. If null
, keys
will not be unwrapped.valueWrapper
- Used to wrap values. If null
, values
will not be wrapped.valueUnwrapper
- Used to unwrap values. If null
,
values will not be unwrapped.
java.lang.NullPointerException
- if map
is null
.Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.util.AbstractMap
java.lang.CloneNotSupportedException
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
get
in class java.util.AbstractMap
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in class java.util.AbstractMap
public void putNoReturn(java.lang.Object key, java.lang.Object value)
AbstractNoReturnMap
put()
-- there is
no speed advantage to using this method.
putNoReturn
in interface INoReturnMap
putNoReturn
in class AbstractNoReturnMap
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in class java.util.AbstractMap
public void removeNoReturn(java.lang.Object key)
AbstractNoReturnMap
remove()
-- there is
no speed advantage to using this method.
removeNoReturn
in interface INoReturnMap
removeNoReturn
in class AbstractNoReturnMap
public java.util.Set entrySet()
entrySet
in interface java.util.Map
entrySet
in class java.util.AbstractMap
public java.util.Set entrySetNoReturn()
AbstractNoReturnMap
entrySet()
to make it an instance
of NoReturnEntrySet
, which contains instances of
INoReturnEntry
.
entrySetNoReturn
in interface INoReturnMap
entrySetNoReturn
in class AbstractNoReturnMap
public int size()
size
in interface java.util.Map
size
in class java.util.AbstractMap
public boolean isEmpty()
isEmpty
in interface java.util.Map
isEmpty
in class java.util.AbstractMap
public void clear()
clear
in interface java.util.Map
clear
in class java.util.AbstractMap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |