Class FormattingCache

  • All Implemented Interfaces:
    Cache

    public class FormattingCache
    extends java.lang.Object
    implements Cache
    • Constructor Summary

      Constructors 
      Constructor Description
      FormattingCache()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean clear()
      clear all components in the cache
      FormatCacheItem get​(java.lang.String cacheKey)
      get a component's cached data by key
      int getCapacityByKey()  
      java.lang.String getDropId()
      get a id of translation drop
      long getExpiredTime()
      get expired time
      long getLastClean()
      get time of last clean
      int getXCapacity()
      get the cache capacity
      boolean isExpired()
      Deprecated.
      Use the isExpired method.
      java.util.Set<java.lang.String> keySet()
      get the set of cached keys
      boolean put​(java.lang.String cacheKey, CacheItem itemToCache)
      put strings to cache by key
      boolean remove​(java.lang.String cacheKey)
      remove a component from cache by key
      void setCapacityByKey​(int keysize)  
      void setDropId​(java.lang.String dropId)  
      void setExpiredTime​(long millis)
      set expired time
      void setLastClean​(long millis)
      set time of last clean
      void setXCapacity​(int capacityX)
      set the cache's capacity by specifying the count of components
      int size()
      get count of current cached components
      • Methods inherited from class java.lang.Object

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

      • FormattingCache

        public FormattingCache()
    • Method Detail

      • get

        public FormatCacheItem get​(java.lang.String cacheKey)
        Description copied from interface: Cache
        get a component's cached data by key
        Specified by:
        get in interface Cache
        Returns:
        CacheItem object instance that holds the cached data (messages and associated properties)
      • put

        public boolean put​(java.lang.String cacheKey,
                           CacheItem itemToCache)
        Description copied from interface: Cache
        put strings to cache by key
        Specified by:
        put in interface Cache
        Parameters:
        cacheKey - cache key
        itemToCache - item to be stored in the cache
        Returns:
        false if failed to put
      • remove

        public boolean remove​(java.lang.String cacheKey)
        Description copied from interface: Cache
        remove a component from cache by key
        Specified by:
        remove in interface Cache
        Returns:
        false if failed to remove
      • clear

        public boolean clear()
        Description copied from interface: Cache
        clear all components in the cache
        Specified by:
        clear in interface Cache
        Returns:
        false if failed to clear
      • size

        public int size()
        Description copied from interface: Cache
        get count of current cached components
        Specified by:
        size in interface Cache
        Returns:
        count of cached components
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Description copied from interface: Cache
        get the set of cached keys
        Specified by:
        keySet in interface Cache
        Returns:
        set of cached keys
      • getExpiredTime

        public long getExpiredTime()
        Description copied from interface: Cache
        get expired time
        Specified by:
        getExpiredTime in interface Cache
        Returns:
        long time
      • setExpiredTime

        public void setExpiredTime​(long millis)
        Description copied from interface: Cache
        set expired time
        Specified by:
        setExpiredTime in interface Cache
      • getLastClean

        public long getLastClean()
        Description copied from interface: Cache
        get time of last clean
        Specified by:
        getLastClean in interface Cache
        Returns:
        long time
      • setLastClean

        public void setLastClean​(long millis)
        Description copied from interface: Cache
        set time of last clean
        Specified by:
        setLastClean in interface Cache
      • setCapacityByKey

        public void setCapacityByKey​(int keysize)
      • getCapacityByKey

        public int getCapacityByKey()
      • setXCapacity

        public void setXCapacity​(int capacityX)
        Description copied from interface: Cache
        set the cache's capacity by specifying the count of components
        Specified by:
        setXCapacity in interface Cache
      • getXCapacity

        public int getXCapacity()
        Description copied from interface: Cache
        get the cache capacity
        Specified by:
        getXCapacity in interface Cache
        Returns:
        cache capacity
      • isExpired

        public boolean isExpired()
        Deprecated.
        Use the isExpired method.
        Specified by:
        isExpired in interface Cache
      • getDropId

        public java.lang.String getDropId()
        Description copied from interface: Cache
        get a id of translation drop
        Specified by:
        getDropId in interface Cache
        Returns:
        a drop id
      • setDropId

        public void setDropId​(java.lang.String dropId)