public class DefaultImmutableMap<S,T> extends java.lang.Object implements ImmutableMap<S,T>
Modifier | Constructor and Description |
---|---|
protected |
DefaultImmutableMap()
only for use by NILMap
|
protected |
DefaultImmutableMap(ImmutableMapEntry<S,T> entry)
creates new map with mapping entry
|
protected |
DefaultImmutableMap(ImmutableMapEntry<S,T> entry,
DefaultImmutableMap<S,T> parent)
creates new map with mapping entry and parent map
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(S key) |
boolean |
containsValue(T value) |
boolean |
equals(java.lang.Object o) |
T |
get(S key) |
int |
hashCode() |
boolean |
isEmpty()
returns true if the map is empty
|
java.util.Iterator<ImmutableMapEntry<S,T>> |
iterator() |
java.util.Iterator<S> |
keyIterator() |
static <S,T> DefaultImmutableMap<S,T> |
nilMap()
the empty map
|
ImmutableMap<S,T> |
put(S key,
T value)
inserts mapping
null is not allowed for key or value. |
DefaultImmutableMap<S,T> |
remove(S key)
removes mapping (key,...) from map
|
ImmutableMap<S,T> |
removeAll(T value)
removes all mappings (...,value) from map
|
int |
size() |
java.lang.String |
toString() |
java.util.Iterator<T> |
valueIterator() |
protected DefaultImmutableMap()
protected DefaultImmutableMap(ImmutableMapEntry<S,T> entry)
protected DefaultImmutableMap(ImmutableMapEntry<S,T> entry, DefaultImmutableMap<S,T> parent)
public static <S,T> DefaultImmutableMap<S,T> nilMap()
public ImmutableMap<S,T> put(S key, T value)
null
is not allowed for key or value.put
in interface ImmutableMap<S,T>
key
- a S to be used as keyvalue
- a T to be stored as valuepublic T get(S key)
get
in interface ImmutableMap<S,T>
public int size()
size
in interface ImmutableMap<S,T>
public boolean isEmpty()
isEmpty
in interface ImmutableMap<S,T>
public boolean containsKey(S key)
containsKey
in interface ImmutableMap<S,T>
public boolean containsValue(T value)
containsValue
in interface ImmutableMap<S,T>
public DefaultImmutableMap<S,T> remove(S key)
remove
in interface ImmutableMap<S,T>
public ImmutableMap<S,T> removeAll(T value)
removeAll
in interface ImmutableMap<S,T>
public java.util.Iterator<S> keyIterator()
keyIterator
in interface ImmutableMap<S,T>
public java.util.Iterator<T> valueIterator()
valueIterator
in interface ImmutableMap<S,T>
public java.util.Iterator<ImmutableMapEntry<S,T>> iterator()
iterator
in interface java.lang.Iterable<ImmutableMapEntry<S,T>>
iterator
in interface ImmutableMap<S,T>
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2003-2019 The KeY-Project.