Interface Cache
-
- All Known Implementing Classes:
FormattingCache,MessageCache,MessageCache2
public interface Cache
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanclear()clear all components in the cacheCacheItemget(java.lang.String key)get a component's cached data by keyjava.lang.StringgetDropId()get a id of translation droplonggetExpiredTime()get expired timelonggetLastClean()get time of last cleanintgetXCapacity()get the cache capacitybooleanisExpired()Deprecated.Use theisExpiredmethod.java.util.Set<java.lang.String>keySet()get the set of cached keysbooleanput(java.lang.String key, CacheItem cacheItem)put strings to cache by keybooleanremove(java.lang.String key)remove a component from cache by keyvoidsetExpiredTime(long millis)set expired timevoidsetLastClean(long millis)set time of last cleanvoidsetXCapacity(int capacityX)set the cache's capacity by specifying the count of componentsintsize()get count of current cached components
-
-
-
Method Detail
-
get
CacheItem get(java.lang.String key)
get a component's cached data by key- Parameters:
key-- Returns:
- CacheItem object instance that holds the cached data (messages and associated properties)
-
put
boolean put(java.lang.String key, CacheItem cacheItem)put strings to cache by key- Parameters:
key- cache keycacheItem- item to be stored in the cache- Returns:
- false if failed to put
-
remove
boolean remove(java.lang.String key)
remove a component from cache by key- Parameters:
key-- Returns:
- false if failed to remove
-
clear
boolean clear()
clear all components in the cache- Returns:
- false if failed to clear
-
size
int size()
get count of current cached components- Returns:
- count of cached components
-
keySet
java.util.Set<java.lang.String> keySet()
get the set of cached keys- Returns:
- set of cached keys
-
getExpiredTime
long getExpiredTime()
get expired time- Returns:
- long time
-
setExpiredTime
void setExpiredTime(long millis)
set expired time- Parameters:
millis-
-
getLastClean
long getLastClean()
get time of last clean- Returns:
- long time
-
setLastClean
void setLastClean(long millis)
set time of last clean- Parameters:
millis-
-
setXCapacity
void setXCapacity(int capacityX)
set the cache's capacity by specifying the count of components- Parameters:
capacityX-
-
getXCapacity
int getXCapacity()
get the cache capacity- Returns:
- cache capacity
-
isExpired
boolean isExpired()
Deprecated.Use theisExpiredmethod.
-
getDropId
java.lang.String getDropId()
get a id of translation drop- Returns:
- a drop id
-
-