Class CacheableElement
java.lang.Object
io.john.amiscaray.stir.domain.elements.CacheableElement
- Direct Known Subclasses:
AbstractUIElement
public abstract class CacheableElement extends Object
The base class for element cache operations
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CacheableElement.CacheStatus
-
Field Summary
Fields Modifier and Type Field Description private String
cacheContents
The cache contents for the elementprotected boolean
cacheDisabled
Whether to disable caching on the elementprotected CacheableElement.CacheStatus
cacheStatus
Used to keep track of the cache freshness.private boolean
hasChildren
Whether the element has children elements (used for caching purposes)protected PropertyChangeSupport
propertyChangeSupport
Used to listen for object property change events to appropriately update the cache -
Constructor Summary
Constructors Constructor Description CacheableElement()
-
Method Summary
Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener listener)
Adds an event listener for any changes to the objectvoid
emptyCache()
String
getCacheContents()
CacheableElement.CacheStatus
getCacheStatus()
boolean
isCacheDisabled()
boolean
isHasChildren()
void
setCacheContents(String cacheContents)
void
setCacheDisabled(boolean cacheDisabled)
void
setHasChildren(boolean hasChildren)
-
Field Details
-
propertyChangeSupport
Used to listen for object property change events to appropriately update the cache -
cacheStatus
Used to keep track of the cache freshness. See theCacheStatus enum
-
cacheContents
The cache contents for the element -
hasChildren
private boolean hasChildrenWhether the element has children elements (used for caching purposes) -
cacheDisabled
protected boolean cacheDisabledWhether to disable caching on the element
-
-
Constructor Details
-
CacheableElement
public CacheableElement()
-
-
Method Details
-
getCacheStatus
-
getCacheContents
-
isHasChildren
public boolean isHasChildren() -
isCacheDisabled
public boolean isCacheDisabled() -
setHasChildren
public void setHasChildren(boolean hasChildren) -
setCacheDisabled
public void setCacheDisabled(boolean cacheDisabled) -
setCacheContents
-
emptyCache
public void emptyCache() -
addPropertyChangeListener
Adds an event listener for any changes to the object- Parameters:
listener
- APropertyChangeListener
for when an object property changes
-