Interface Map<K,V>
-
- All Superinterfaces:
Iterable<Pair<K,V>>
,java.lang.Iterable<Pair<K,V>>
,Traversable<Pair<K,V>>
- All Known Subinterfaces:
SortedMap<K,V>
- All Known Implementing Classes:
AbstractMap
,AbstractSortedMap
,DerivedKeyHashMap
,HashMap
,ListMap
,ListMap.Node
,TreeMap
public interface Map<K,V> extends Iterable<Pair<K,V>>
Map
defines the interface for maps that associate keys with values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<K,V>
asMap()
Returns an immutable view of this map as an instance ofMap
.boolean
containsKey(K key)
Returns true if this map contains the specified key.V
get(K key)
Returns the value associated with the key ornull
if the no value exists with the key specified.@NotNull Iterable<K>
keys()
Returns the keys for this map.@NotNull Map<K,V>
put(K key, V value)
Returns a map with the value specified associated to the key specified.@NotNull Map<K,V>
remove(K key)
Returns a map with the value associated with the key removed if it exists.@NotNull Iterable<V>
values()
Returns the values for this map.-
Methods inherited from interface com.github.andrewoma.dexx.collection.Traversable
forEach, isEmpty, makeString, makeString, size, to, toArray, toArray, toIndexedList, toSet, toSortedSet
-
-
-
-
Method Detail
-
put
@NotNull @NotNull Map<K,V> put(@NotNull K key, V value)
Returns a map with the value specified associated to the key specified.If value already exists for the key, it will be replaced.
-
get
@Nullable V get(@NotNull K key)
Returns the value associated with the key ornull
if the no value exists with the key specified.
-
remove
@NotNull @NotNull Map<K,V> remove(@NotNull K key)
Returns a map with the value associated with the key removed if it exists.
-
containsKey
boolean containsKey(@NotNull K key)
Returns true if this map contains the specified key.
-
-