|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.cache.CacheElement
public final class CacheElement
Represent a single entry in the cache.
Constructor Summary | |
---|---|
CacheElement(CacheElement ce)
Create a new shallow clone of a given CacheElement . |
|
CacheElement(java.lang.String name,
java.lang.String type,
Cacheable object,
long lastModified)
Create a new CacheElement . |
Method Summary | |
---|---|
void |
age()
Age this element in the cache. |
java.lang.Object |
clone()
Performs a shallow clone of the CacheElement . |
int |
compareTo(CacheElement target)
Compares another CacheElement against this one. |
int |
compareTo(java.lang.Object obj)
Compares an object against this CacheElement . |
java.lang.String |
getName()
Retrieve the name of the element being cached. |
Cacheable |
getObject()
Retrieve the object being cached. |
java.lang.String |
getType()
Retrieve the type of object being cached. |
boolean |
isExpired(int age)
Has the object in this cache element expired? |
long |
lastModified()
Retrieve the time the element was last modified, according to the cache. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CacheElement(java.lang.String name, java.lang.String type, Cacheable object, long lastModified)
CacheElement
.
name
- the canonical name of the elementtype
- the type of objectobject
- the object to be storedlastModified
- the time the object was last modified in the data storepublic CacheElement(CacheElement ce)
CacheElement
.
ce
- the cache element to be clonedMethod Detail |
---|
public java.lang.String getName()
public long lastModified()
public Cacheable getObject()
public java.lang.String getType()
public void age()
public boolean isExpired(int age)
age
- the age at which this element would expire
true
if the element has expired, otherwise
false
public int compareTo(java.lang.Object obj)
CacheElement
.
compareTo
in interface java.lang.Comparable
obj
- the object to be compared
java.lang.ClassCastException
- the object cannot be comparedpublic int compareTo(CacheElement target)
CacheElement
against this one.
target
- the CacheElement
to be compared
public java.lang.Object clone()
CacheElement
.
The object being cached is not cloned, only a reference to it.
clone
in class java.lang.Object
CacheElement
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of the object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |