|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javautils.maps.AbstractTypedMap | +--javautils.maps.ObjectToBooleanMap
Map from objects to boolean-values. BooleanHolder
-objects are
used for storing the values in the map.
Field Summary |
Fields inherited from class javautils.maps.AbstractTypedMap |
map |
Constructor Summary | |
ObjectToBooleanMap()
A new map based on the map type used by AbstractTypedMap.AbstractTypedMap(java.util.Map) . |
|
ObjectToBooleanMap(java.util.Map map)
A new Object->boolean map using the given map. |
Method Summary | |
boolean |
get(java.lang.Object key)
The value associated with the key - throws an assertion exception if the key is not associated with a value. |
boolean |
getOr(java.lang.Object key,
boolean alternative)
The value associated with the key or the specified alternative value if the key is not associated with any value. |
BooleanHolder |
holder(java.lang.Object key)
The holder of the value associated with the key or null if the key is not associated with a value. |
void |
put(java.lang.Object key,
boolean value)
Associates the key with the specified value. |
void |
put(java.lang.Object key,
BooleanHolder holder)
Associates the key with the specified holder. |
BooleanHolder |
ref(java.lang.Object key)
The holder associated with the key - throws an assertion exception if the key is not associated with a value. |
BooleanHolder |
refOr(java.lang.Object key,
boolean value)
The holder associated with the key or a new holder that holds the specified value and associated with the key. |
protected boolean |
valuePredicate(java.lang.Object value)
Tests that the value is a non null BooleanHolder -object. |
Methods inherited from class javautils.maps.AbstractTypedMap |
clear, clone, containsKey, isEmpty, keyIterator, keySet, remove, size, toString, unmodifiableMap, valueIterator |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ObjectToBooleanMap()
A new map based on the map type used by AbstractTypedMap.AbstractTypedMap(java.util.Map)
.
public ObjectToBooleanMap(java.util.Map map)
A new Object->boolean
map using the given map. The
given map must not contain any values that are not BooleanHolder
-objects. The given map should also never be modified
except by using the services of this class.
Method Detail |
protected boolean valuePredicate(java.lang.Object value)
Tests that the value is a non null
BooleanHolder
-object.
valuePredicate
in class AbstractTypedMap
public void put(java.lang.Object key, boolean value)
Associates the key with the specified value. Will not create a new holder if the key is already associated with a value.
public void put(java.lang.Object key, BooleanHolder holder)
Associates the key with the specified holder.
public boolean get(java.lang.Object key)
The value associated with the key - throws an assertion exception if the key is not associated with a value.
public boolean getOr(java.lang.Object key, boolean alternative)
The value associated with the key or the specified alternative value if the key is not associated with any value.
public BooleanHolder ref(java.lang.Object key)
The holder associated with the key - throws an assertion exception if the key is not associated with a value.
public BooleanHolder refOr(java.lang.Object key, boolean value)
The holder associated with the key or a new holder that holds the specified value and associated with the key.
public BooleanHolder holder(java.lang.Object key)
The holder of the value associated with the key or null if the key is not associated with a value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |