Class ReadOnlyMapFacade<K,V>

java.lang.Object
org.jhotdraw8.icollection.facade.ReadOnlyMapFacade<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:
ReadOnlyNavigableMapFacade, ReadOnlySequencedMapFacade, ReadOnlySortedMapFacade

public class ReadOnlyMapFacade<K,V> extends Object implements ReadOnlyMap<K,V>
Provides a ReadOnlyMap facade to a set of ReadOnlyMap functions.
Author:
Werner Randelshofer
  • Field Details

  • Constructor Details

  • Method Details

    • get

      public @Nullable V get(Object key)
      Description copied from interface: ReadOnlyMap
      Returns the value to which the key is mapped, or null if this map contains no entry for the key.
      Specified by:
      get in interface ReadOnlyMap<K,V>
      Parameters:
      key - a key
      Returns:
      the mapped value or null
    • containsKey

      public boolean containsKey(Object key)
      Description copied from interface: ReadOnlyMap
      Returns true if this map contains a entry for the specified key.
      Specified by:
      containsKey in interface ReadOnlyMap<K,V>
      Parameters:
      key - a key
      Returns:
      true if this map contains a entry for the specified key
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: ReadOnlyMap
      Returns true if this map contains no entries.
      Specified by:
      isEmpty in interface ReadOnlyMap<K,V>
      Returns:
      true if empty
    • iterator

      public Iterator<Map.Entry<K,V>> iterator()
      Description copied from interface: ReadOnlyMap
      Returns an iterator over the entries contained in this map.
      Specified by:
      iterator in interface Iterable<K>
      Specified by:
      iterator in interface ReadOnlyMap<K,V>
      Returns:
      an iterator
    • size

      public int size()
      Description copied from interface: ReadOnlyMap
      Returns the number of entries contained in this map..
      Specified by:
      size in interface ReadOnlyMap<K,V>
      Returns:
      the number of entries
    • containsEntry

      public boolean containsEntry(@Nullable Object o)
      Description copied from interface: ReadOnlyMap
      Returns true if this map contains the specified entry.
      Specified by:
      containsEntry in interface ReadOnlyMap<K,V>
      Parameters:
      o - an entry (should be a Map.Entry).
      Returns:
      true if this map contains the entry