Klasse AbstractMap<K,V>

java.lang.Object
org.jupnp.support.shared.AbstractMap<K,V>
Alle implementierten Schnittstellen:
Map<K,V>

public abstract class AbstractMap<K,V> extends Object implements Map<K,V>
A base class for Map implementations.

Subclasses that permit new mappings to be added must override put(K, V).

The default implementations of many methods are inefficient for large maps. For example in the default implementation, each call to get(java.lang.Object) performs a linear iteration of the entry set. Subclasses should override such methods to improve their performance.

Seit:
1.2
  • Konstruktordetails

    • AbstractMap

      protected AbstractMap()
  • Methodendetails

    • clear

      public void clear()

      This implementation calls entrySet().clear().

      Angegeben von:
      clear in Schnittstelle Map<K,V>
    • containsKey

      public boolean containsKey(Object key)

      This implementation iterates its key set, looking for a key that key equals.

      Angegeben von:
      containsKey in Schnittstelle Map<K,V>
    • containsValue

      public boolean containsValue(Object value)

      This implementation iterates its entry set, looking for an entry with a value that value equals.

      Angegeben von:
      containsValue in Schnittstelle Map<K,V>
    • entrySet

      public abstract Set<Map.Entry<K,V>> entrySet()
      Angegeben von:
      entrySet in Schnittstelle Map<K,V>
    • equals

      public boolean equals(Object object)

      This implementation first checks the structure of object. If it is not a map or of a different size, this returns false. Otherwise it iterates its own entry set, looking up each entry's key in object. If any value does not equal the other map's value for the same key, this returns false. Otherwise it returns true.

      Angegeben von:
      equals in Schnittstelle Map<K,V>
      Setzt außer Kraft:
      equals in Klasse Object
    • get

      public V get(Object key)

      This implementation iterates its entry set, looking for an entry with a key that key equals.

      Angegeben von:
      get in Schnittstelle Map<K,V>
    • hashCode

      public int hashCode()

      This implementation iterates its entry set, summing the hashcodes of its entries.

      Angegeben von:
      hashCode in Schnittstelle Map<K,V>
      Setzt außer Kraft:
      hashCode in Klasse Object
    • isEmpty

      public boolean isEmpty()

      This implementation compares size() to 0.

      Angegeben von:
      isEmpty in Schnittstelle Map<K,V>
    • keySet

      public Set<K> keySet()

      This implementation returns a view that calls through this to map. Its iterator transforms this map's entry set iterator to return keys.

      Angegeben von:
      keySet in Schnittstelle Map<K,V>
    • put

      public V put(K key, V value)

      This base implementation throws UnsupportedOperationException.

      Angegeben von:
      put in Schnittstelle Map<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> map)

      This implementation iterates through map's entry set, calling put() for each.

      Angegeben von:
      putAll in Schnittstelle Map<K,V>
    • remove

      public V remove(Object key)

      This implementation iterates its entry set, removing the entry with a key that key equals.

      Angegeben von:
      remove in Schnittstelle Map<K,V>
    • size

      public int size()

      This implementation returns its entry set's size.

      Angegeben von:
      size in Schnittstelle Map<K,V>
    • toString

      public String toString()

      This implementation composes a string by iterating its entry set. If this map contains itself as a key or a value, the string "(this Map)" will appear in its place.

      Setzt außer Kraft:
      toString in Klasse Object
    • values

      public Collection<V> values()

      This implementation returns a view that calls through this to map. Its iterator transforms this map's entry set iterator to return values.

      Angegeben von:
      values in Schnittstelle Map<K,V>
    • clone

      protected Object clone() throws CloneNotSupportedException
      Setzt außer Kraft:
      clone in Klasse Object
      Löst aus:
      CloneNotSupportedException