Class MapCache

    • Constructor Detail

      • MapCache

        public MapCache​(Map map,
                        String name)
    • Method Detail

      • get

        public Object get​(String key)
        Description copied from interface: ICache
        get a item from cache.
        Specified by:
        get in interface ICache
        Returns:
      • put

        public void put​(String key,
                        Object item)
        Description copied from interface: ICache
        add item to cache
        Specified by:
        put in interface ICache
        Parameters:
        key - the key of item
      • removeItem

        public boolean removeItem​(String key)
        Description copied from interface: ICache
        remove item and return true if removed.
        Specified by:
        removeItem in interface ICache
        Returns:
      • removeAll

        public void removeAll()
        Description copied from interface: ICache
        remove all items from cache.
        Specified by:
        removeAll in interface ICache
      • getSize

        public int getSize()
        Description copied from interface: ICache
        return the number of items contains in Cache.
        Specified by:
        getSize in interface ICache
        Returns:
      • getKeys

        public Collection<String> getKeys()
        Description copied from interface: ICache
        return all keys contains in cache.
        Specified by:
        getKeys in interface ICache
        Returns:
      • getName

        public String getName()
        Description copied from interface: ICache
        get the name of the cache.
        Specified by:
        getName in interface ICache
        Returns: