Package org.eclipse.emf.common.util
Interface EMap<K,V>
- All Superinterfaces:
Collection<Map.Entry<K,,V>> EList<Map.Entry<K,,V>> Iterable<Map.Entry<K,,V>> List<Map.Entry<K,,V>> SequencedCollection<Map.Entry<K,V>>
- All Known Implementing Classes:
BasicEMap
A list of
java.util.Map.Entry instances, i.e., entries, that
supports a map() view
as well as the full Map API,
with the notable exception of Map.remove(Object).
It's return type conflicts with that of Collection.remove(Object).
The removeKey(Object) method may be used instead.
The implementation of remove may delegate to removeKey
for an object that is not an instance of Map.Entry.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn internal interface implemented by themap view. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) Returns whether the key is associated with a value.booleancontainsValue(Object value) Returns whether the value is associated with a key.entrySet()Returns a set view of the entries.Returns the value associated with the key.intindexOfKey(Object key) Returns the index in the list of the entry with the given key, or-1, if there is no such entry.keySet()Returns a set view of the keys of the entries.map()Returns a map view.Associates the key with the value and returns the value previously associated with the key, ornull.voidPuts eachMap.Entryof the given map into this one.voidPuts eachMap.Entryof the given map into this one.Disassociates the key from its value, and returns the value formerly associated with the key.values()Returns a collection view the values of the entries.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Method Details
-
get
Returns the value associated with the key. The key, the value, or both may benull.- Parameters:
key- the key of the value.- Returns:
- the value associated with the key.
-
put
Associates the key with the value and returns the value previously associated with the key, ornull. The key, the value, or both may benull. Either the existing entry is updated, or a new entry is added to the end of the list.- Parameters:
key- the key of the value.value- the value associated with the key.- Returns:
- the value formerly associated with the key, or
null.
-
putAll
Puts eachMap.Entryof the given map into this one.- Parameters:
map- the map of entries.- See Also:
-
putAll
Puts eachMap.Entryof the given map into this one.- Parameters:
map- the map of entries.- See Also:
-
indexOfKey
Returns the index in the list of the entry with the given key, or-1, if there is no such entry.- Parameters:
key- a key.- Returns:
- the index of the entry with the given key.
-
containsKey
Returns whether the key is associated with a value.- Parameters:
key- a key associated with a value.- Returns:
- whether the key is associated with a value.
-
containsValue
Returns whether the value is associated with a key.- Parameters:
value- a value associated with a key.- Returns:
- whether the value is associated with a key.
-
removeKey
Disassociates the key from its value, and returns the value formerly associated with the key. An entry is removed from the list, if the key is found.- Parameters:
key- the key of a value.- Returns:
- the value formerly associated with the key.
-
map
Returns a map view.- Returns:
- a map view.
-
entrySet
Returns a set view of the entries.- Returns:
- a set view of the entries.
-
keySet
Returns a set view of the keys of the entries.- Returns:
- a set view of the keys of the entries.
-
values
Collection<V> values()Returns a collection view the values of the entries.- Returns:
- a collection view the values of the entries.
-