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>>
All Known Implementing Classes:
BasicEMap

public interface EMap<K,V> extends EList<Map.Entry<K,V>>
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.
  • Method Details

    • get

      V get(Object key)
      Returns the value associated with the key. The key, the value, or both may be null.
      Parameters:
      key - the key of the value.
      Returns:
      the value associated with the key.
    • put

      V put(K key, V value)
      Associates the key with the value and returns the value previously associated with the key, or null. The key, the value, or both may be null. 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

      void putAll(Map<? extends K,? extends V> map)
      Puts each Map.Entry of the given map into this one.
      Parameters:
      map - the map of entries.
      See Also:
    • putAll

      void putAll(EMap<? extends K,? extends V> map)
      Puts each Map.Entry of the given map into this one.
      Parameters:
      map - the map of entries.
      See Also:
    • indexOfKey

      int indexOfKey(Object key)
      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

      boolean containsKey(Object key)
      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

      boolean containsValue(Object value)
      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

      V removeKey(Object key)
      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

      Map<K,V> map()
      Returns a map view.
      Returns:
      a map view.
    • entrySet

      Set<Map.Entry<K,V>> entrySet()
      Returns a set view of the entries.
      Returns:
      a set view of the entries.
    • keySet

      Set<K> 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.