|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractMap<OK,OV>
umontreal.iro.lecuyer.collections.TransformingMap<OK,OV,IK,IV>
OK - the type of the outer keysOV - the type of the outer valuesIK - the type of the inner keysIV - the type of the inner valuespublic abstract class TransformingMap<OK,OV,IK,IV>
Represents a map that dynamically transforms the elements of another map. This abstract class defines a map containing an inner map of elements with certain key and value types, and provides facilities to convert keys and values to outer other types. A concrete subclass simply needs to provide methods for converting keys and values between the inner and the outer types. The mapping established for the keys by these methods must be one-to-one. Otherwise, the size of the outer map might be incorrect, and the iterators may give the same entry multiple times. Also, a null key or value should always correspond to a null element.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
TransformingMap(Map<IK,IV> innerMap)
Constructs a new transforming map converting keys and values of map innerMap. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
abstract OK |
convertKeyFromInnerType(IK key)
Converts the key for the inner map to a key for the outer map. |
abstract IK |
convertKeyToInnerType(OK key)
Converts the key for the outer map to a key for the inner map. |
abstract OV |
convertValueFromInnerType(IV value)
Converts the value for the inner map to a value for the outer map. |
abstract IV |
convertValueToInnerType(OV value)
Converts the value for the outer map to a value for the inner map. |
Set<Map.Entry<OK,OV>> |
entrySet()
|
OV |
get(Object key)
|
Map<IK,IV> |
getInnerMap()
Returns the inner map associated with this map. |
boolean |
isEmpty()
|
Set<OK> |
keySet()
|
OV |
put(OK key,
OV value)
|
OV |
remove(Object key)
|
int |
size()
|
Collection<OV> |
values()
|
| Methods inherited from class java.util.AbstractMap |
|---|
clone, equals, hashCode, putAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TransformingMap(Map<IK,IV> innerMap)
innerMap - the inner map.
NullPointerException - if innerMap is null.| Method Detail |
|---|
public Map<IK,IV> getInnerMap()
public abstract OK convertKeyFromInnerType(IK key)
key - the inner key.
public abstract IK convertKeyToInnerType(OK key)
key - the outer key.
public abstract OV convertValueFromInnerType(IV value)
value - the inner value.
public abstract IV convertValueToInnerType(OV value)
value - the outer value.
public void clear()
clear in interface Map<OK,OV>clear in class AbstractMap<OK,OV>public boolean containsKey(Object key)
containsKey in interface Map<OK,OV>containsKey in class AbstractMap<OK,OV>public boolean containsValue(Object value)
containsValue in interface Map<OK,OV>containsValue in class AbstractMap<OK,OV>public Set<Map.Entry<OK,OV>> entrySet()
entrySet in interface Map<OK,OV>entrySet in class AbstractMap<OK,OV>public Set<OK> keySet()
keySet in interface Map<OK,OV>keySet in class AbstractMap<OK,OV>public Collection<OV> values()
values in interface Map<OK,OV>values in class AbstractMap<OK,OV>public OV get(Object key)
get in interface Map<OK,OV>get in class AbstractMap<OK,OV>public boolean isEmpty()
isEmpty in interface Map<OK,OV>isEmpty in class AbstractMap<OK,OV>
public OV put(OK key,
OV value)
put in interface Map<OK,OV>put in class AbstractMap<OK,OV>public OV remove(Object key)
remove in interface Map<OK,OV>remove in class AbstractMap<OK,OV>public int size()
size in interface Map<OK,OV>size in class AbstractMap<OK,OV>
|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||