Interface Cache
- All Known Implementing Classes:
FormattingCache,MessageCache,MessageCache2
public interface Cache
-
Method Summary
Modifier and TypeMethodDescriptionbooleanclear()clear all components in the cacheget a component's cached data by keyget a id of translation droplongget expired timelongget time of last cleanintget the cache capacitybooleanDeprecated.keySet()get the set of cached keysbooleanput strings to cache by keybooleanremove 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 Details
-
get
get a component's cached data by key- Parameters:
key-- Returns:
- CacheItem object instance that holds the cached data (messages and associated properties)
-
put
put strings to cache by key- Parameters:
key- cache keycacheItem- item to be stored in the cache- Returns:
- false if failed to put
-
remove
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
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
String getDropId()get a id of translation drop- Returns:
- a drop id
-
isExpiredmethod.