public abstract class BaseCache extends Object implements ManagedCache
Constructor and Description |
---|
BaseCache() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addToCache(String name,
Object value)
Internal method for BaseCache to actually add items to the implementing
cache.
|
void |
clear()
Clear all values from the cache.
|
protected abstract void |
clearCache() |
protected abstract boolean |
contains(String name)
Internal method for BaseCache to actually check if the name exists in the
implementing cache.
|
void |
expire(String name)
Expire an item in the cache.
|
protected abstract void |
expireItem(String name) |
<T> T |
get(String name,
Class<? extends T> cls)
Get a value from the cache.
|
boolean |
getBool(String name) |
byte |
getByte(String name) |
double |
getDouble(String name) |
float |
getFloat(String name) |
protected abstract Object |
getFromCache(String name)
Internal method for BaseCache to actually retrieve items from the
implementing cache.
|
int |
getInt(String name) |
short |
getShort(String name) |
void |
put(String name,
Object value)
Add a value to the cache.
|
protected abstract void |
removeFromCache(String name)
Internal method for BaseCache to actually remove items from the
implementing cache.
|
void |
timeout()
Clear out any values that should be timed out.
|
protected abstract void |
timeoutCache() |
protected abstract void addToCache(String name, Object value)
name
- value
- public void clear()
ManagedCache
clear
in interface ManagedCache
protected abstract void clearCache()
protected abstract boolean contains(String name)
name
- public void expire(String name)
expire
in interface Cache
expire
in interface ManagedCache
name
- the nameprotected abstract void expireItem(String name)
public boolean getBool(String name)
public byte getByte(String name)
public double getDouble(String name)
public float getFloat(String name)
protected abstract Object getFromCache(String name)
name
- public int getInt(String name)
public short getShort(String name)
protected abstract void removeFromCache(String name)
name
- public void timeout()
ManagedCache
timeout
in interface ManagedCache
protected abstract void timeoutCache()
Copyright © 2020 myrobotlab. All rights reserved.