net.sf.ehcache
public final class Element extends Object implements Serializable, Cloneable
Version: $Id: Element.java 191 2006-09-03 22:41:48Z gregluck $
UNKNOWN: SerializableHasSerializationMethods
Constructor Summary | |
---|---|
Element(Serializable key, Serializable value, long version)
A full constructor.
| |
Element(Object key, Object value, long version)
A full constructor.
| |
Element(Serializable key, Serializable value)
Constructor.
| |
Element(Object key, Object value)
Constructor.
|
Method Summary | |
---|---|
Object | clone()
Clones an Element. |
boolean | equals(Object object)
Equals comparison with another element, based on the key. |
long | getCreationTime()
Gets the creationTime attribute of the ElementAttributes object.
|
long | getExpirationTime()
Returns the expiration time based on time to live. |
long | getHitCount()
Gets the hit count on this element. |
Serializable | getKey()
Gets the key attribute of the Element object.
|
long | getLastAccessTime()
Gets the last access time.
|
long | getLastUpdateTime()
If there is an Element in the Cache and it is replaced with a new Element for the same key,
then both the version number and lastUpdateTime should be updated to reflect that. |
long | getNextToLastAccessTime()
Gets the next to last access time. |
Object | getObjectKey()
Gets the key attribute of the Element object.
|
Object | getObjectValue()
Gets the value attribute of the Element object as an Object.
|
long | getSerializedSize()
The size of this object in serialized form. |
int | getTimeToIdle() |
int | getTimeToLive() |
Serializable | getValue()
Gets the value attribute of the Element object.
|
long | getVersion()
Gets the version attribute of the ElementAttributes object.
|
int | hashCode()
Gets the hascode, based on the key. |
boolean | isEternal() |
boolean | isExpired()
An element is expired if the expiration time as given by getExpirationTime is in the past.
|
boolean | isKeySerializable()
Whether the element's key may be Serialized.
|
boolean | isLifespanSet()
Whether any combination of eternal, TTL or TTI has been set.
|
boolean | isSerializable()
Whether the element may be Serialized.
|
void | resetAccessStatistics()
Resets the hit count to 0 and the last access time to 0. |
void | setCreateTime()
Sets the creationTime attribute of the ElementAttributes object. |
void | setEternal(boolean eternal)
Sets whether the element is eternal.
|
void | setTimeToIdle(int timeToIdleSeconds)
Sets time to idle
|
void | setTimeToLive(int timeToLiveSeconds)
Sets time to Live
|
void | setVersion(long version)
Sets the version attribute of the ElementAttributes object.
|
String | toString()
Returns a String representation of the Element. |
void | updateAccessStatistics()
Sets the last access time to now. |
void | updateUpdateStatistics()
Sets the last access time to now. |
Since: .4
Since: 1.2
Parameters: key value
Parameters: key value
Since: 1.2
Returns: a new Element, with exactly the same field values as the one it was cloned from.
Throws: CloneNotSupportedException
Returns: The creationTime value
Returns: the time to expiration
Returns: The key value. If the key is not Serializable, null is returned and an info log message emitted
See Also: getObjectKey
Returns: the time when the last update occured. If this is the original Element, the time will be null
See Also: getLastAccessTime
Returns: The key as an Object. i.e no restriction is placed on it
See Also: getKey
Returns: The value as an Object. i.e no restriction is placed on it
Since: 1.2
See Also: getValue
Returns: The serialized size in bytes
Returns: the time to idle, in seconds
Returns: the time to live, in seconds
Returns: The value which must be Serializable. If not use Element. If the value is not Serializable, null is returned and an info log message emitted
See Also: getObjectValue
Returns: The version value
Returns: true if the element is eternal
Returns: true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is considered not able to expire.
See Also: getExpirationTime
Returns: true if the element's key is Serializable
Since: 1.2
Returns: true if set.
Returns: true if the element is Serializable
Since: 1.2
Parameters: eternal
Parameters: timeToIdleSeconds the number of seconds to idle
Parameters: timeToLiveSeconds the number of seconds to live
Parameters: version The new version value