|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjasi.sim.basic.table.ConditionMap<K,V>
K
- Key type.V
- Value type.public final class ConditionMap<K,V>
Map of conditions, which provides access to an if-then-else structure. If a key is not contained in this condition map, it will return a value of the else-key (null), if this is contained in this map, otherwise null.
Nested Class Summary | |
---|---|
class |
ConditionMap.Entry
Entry in a condition map. |
Constructor Summary | |
---|---|
ConditionMap()
Constructor for ConditionMap. |
Method Summary | |
---|---|
void |
clear()
Removes all mappings from this map. |
boolean |
containsKey(java.lang.Object 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<K,V>> |
entrySet()
Returns a set view of the mappings contained in this map. |
boolean |
equals(java.lang.Object o)
Compares the specified object with this map for equality. |
V |
get(java.lang.Object key)
Returns the value to which the specified key is mapped in this identity hash map, or null if the map contains no mapping for this key. |
V |
getElse(java.lang.Object key)
Returns the value to which this map maps the specified key. |
int |
hashCode()
Returns the hash code value for this map. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
java.util.Set<K> |
keySet()
Returns a set view of the keys contained in this map. |
V |
put(K key,
V value)
Associates the specified value with the specified key in this map. |
void |
putAll(java.util.Map<? extends K,? extends V> t)
Copies all of the mappings from the specified map to this map. |
V |
putElse(V value)
n this map. |
V |
remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present. |
int |
size()
Returns the number of key-value mappings in this map. |
java.lang.String |
toString()
Returns a string representation of this object. |
java.util.Collection<V> |
values()
Returns a collection view of the values contained in this map. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConditionMap()
Method Detail |
---|
public V putElse(V value)
value
- The value for the else-condition.
public int size()
size
in interface java.util.Map<K,V>
Map.size()
public boolean isEmpty()
isEmpty
in interface java.util.Map<K,V>
Map.isEmpty()
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<K,V>
key
- The key whose presence in this map is to be tested.
Map.containsKey(Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<K,V>
value
- The value whose presence in this map is to be tested.
Map.containsValue(Object)
public V get(java.lang.Object 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.)
get
in interface java.util.Map<K,V>
key
- The key whose associated value is to be returned.
Map.get(Object)
public V getElse(java.lang.Object 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.)
key
- The key whose associated value is to be returned.
Map.get(Object)
public V put(K key, V value)
put
in interface java.util.Map<K,V>
key
- The key with which the specified value is to be associated. If
null, then value will be else condition.value
- The value to be associated with the specified key.
Map.put(Object, Object)
public V remove(java.lang.Object key)
Returns the value to which the map previously associated the key, or null if the map contained no mapping for this key. (A null return can also indicate that the map previously associated null with the specified key if the implementation supports null values.) The map will not contain a mapping for the specified key once the call returns.
remove
in interface java.util.Map<K,V>
key
- The key whose mapping is to be removed from the map.
Map.remove(Object)
public void putAll(java.util.Map<? extends K,? extends V> t)
putAll
in interface java.util.Map<K,V>
t
- Mappings to be stored in this map.Map.putAll(Map)
public void clear()
clear
in interface java.util.Map<K,V>
Map.clear()
public java.util.Set<K> keySet()
keySet
in interface java.util.Map<K,V>
Map.keySet()
public java.util.Collection<V> values()
values
in interface java.util.Map<K,V>
Map.values()
public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet
in interface java.util.Map<K,V>
Map.entrySet()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map<K,V>
equals
in class java.lang.Object
o
- The object to be compared for equality with this map.
public int hashCode()
hashCode
in interface java.util.Map<K,V>
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |