Class WrappedHashMap

  • All Implemented Interfaces:
    BunchMap

    public class WrappedHashMap
    extends java.lang.Object
    implements BunchMap
    An implementation of BunchMap that delegates to a [Hashed]Map.
    • Constructor Summary

      Constructors 
      Constructor Description
      WrappedHashMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear this map: all entries are removed.
      TripleBunch get​(java.lang.Object key)
      Answer the TripleBunch associated with key, or null if there isn't one.
      TripleBunch getOrSet​(java.lang.Object key, java.util.function.Function<java.lang.Object,​TripleBunch> setter)
      Get the key and return the value found there; if nothing, calculate the value and insert.
      ExtendedIterator<java.lang.Object> keyIterator()
      Answer an iterator over all the keys in this map.
      void put​(java.lang.Object key, TripleBunch value)
      Associate key and value.
      void remove​(java.lang.Object key)
      Remove any association for key; get on this key will now deliver null.
      long size()
      The number of items in the bunch.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WrappedHashMap

        public WrappedHashMap()
    • Method Detail

      • clear

        public void clear()
        Description copied from interface: BunchMap
        Clear this map: all entries are removed.
        Specified by:
        clear in interface BunchMap
      • size

        public long size()
        Description copied from interface: BunchMap
        The number of items in the bunch.
        Specified by:
        size in interface BunchMap
      • get

        public TripleBunch get​(java.lang.Object key)
        Description copied from interface: BunchMap
        Answer the TripleBunch associated with key, or null if there isn't one.
        Specified by:
        get in interface BunchMap
      • put

        public void put​(java.lang.Object key,
                        TripleBunch value)
        Description copied from interface: BunchMap
        Associate key and value. Any existing association of key is lost. get on this key will now deliver this value.
        Specified by:
        put in interface BunchMap
      • getOrSet

        public TripleBunch getOrSet​(java.lang.Object key,
                                    java.util.function.Function<java.lang.Object,​TripleBunch> setter)
        Description copied from interface: BunchMap
        Get the key and return the value found there; if nothing, calculate the value and insert. Return the value now the slot.
        Specified by:
        getOrSet in interface BunchMap
      • remove

        public void remove​(java.lang.Object key)
        Description copied from interface: BunchMap
        Remove any association for key; get on this key will now deliver null.
        Specified by:
        remove in interface BunchMap
      • keyIterator

        public ExtendedIterator<java.lang.Object> keyIterator()
        Description copied from interface: BunchMap
        Answer an iterator over all the keys in this map.
        Specified by:
        keyIterator in interface BunchMap