Class MapBackedDirectory<K,​V>

    • Field Detail

      • map

        protected final Map<K,​V> map
    • Constructor Detail

      • MapBackedDirectory

        public MapBackedDirectory()
        Creates an empty directory backed by an empty Map
      • MapBackedDirectory

        public MapBackedDirectory​(Map<K,​V> map)
        Parameters:
        map -
    • Method Detail

      • getItem

        public V getItem​(K key)
        { @inheritDoc }
        Specified by:
        getItem in interface Directory<K,​V>
        Parameters:
        key - the key used to lookup a particular item
        Returns:
        the value instance associated with the key
      • getItems

        public List<V> getItems()
        { @inheritDoc }
        Specified by:
        getItems in interface Directory<K,​V>
        Returns:
        the Collection of values contained in the directory
      • getKeys

        public Set<K> getKeys()
        { @inheritDoc }
        Specified by:
        getKeys in interface Directory<K,​V>
        Returns:
        the Set of keys contained in the directory
      • size

        public int size()
        { @inheritDoc }
        Specified by:
        size in interface Directory<K,​V>
        Returns:
        the number of items held in the directory
      • isEmpty

        public boolean isEmpty()
        { @inheritDoc }
        Specified by:
        isEmpty in interface Directory<K,​V>
        Returns:
        true if the directory contains no items, false if not.
      • hashCode

        public int hashCode()
        { @inheritDoc }
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        { @inheritDoc }
        Overrides:
        equals in class Object