Class AbstractReadOnlyMap<K,V>

java.lang.Object
org.jhotdraw8.icollection.readonly.AbstractReadOnlyMap<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Iterable<Map.Entry<K,V>>, ReadOnlyMap<K,V>
Direct Known Subclasses:
ImmutableMapFacade

public abstract class AbstractReadOnlyMap<K,V> extends Object implements ReadOnlyMap<K,V>
Abstract base class for ReadOnlyMaps.
  • Constructor Details

    • AbstractReadOnlyMap

      public AbstractReadOnlyMap()
      Constructs a new instance.
  • Method Details

    • equals

      public boolean equals(Object o)
      Description copied from interface: ReadOnlyMap
      Compares the specified object with this map for equality.

      Returns true if the given object is also a read-only map and the two maps represent the same entries, ignorig the sequence of the map entries.

      Specified by:
      equals in interface ReadOnlyMap<K,V>
      Overrides:
      equals in class Object
      Parameters:
      o - an object
      Returns:
      true if the object is equal to this map
    • hashCode

      public int hashCode()
      Description copied from interface: ReadOnlyMap
      Returns the hash code value for this map. The hash code is the sum of the hash code of its entries.
      Specified by:
      hashCode in interface ReadOnlyMap<K,V>
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value for this map
      See Also:
    • toString

      public final String toString()
      Overrides:
      toString in class Object