org.apache.jcs.engine
Class CacheElement

java.lang.Object
  extended by org.apache.jcs.engine.CacheElement
All Implemented Interfaces:
java.io.Serializable, ICacheElement

public class CacheElement
extends java.lang.Object
implements ICacheElement, java.io.Serializable

Generic element wrapper. Often stuffed inside another.

See Also:
Serialized Form

Field Summary
 IElementAttributes attr
          These attributes hold information about the element and what it is allowed to do.
 java.lang.String cacheName
          The name of the cache region.
 java.io.Serializable key
          This is the cache key by which the value can be referenced.
 java.io.Serializable val
          This is the cached value, reference by the key.
 
Constructor Summary
CacheElement(java.lang.String cacheName, java.io.Serializable key, java.lang.Object val)
          Constructor for the CacheElement object
CacheElement(java.lang.String cacheName, java.io.Serializable key, java.io.Serializable val)
          Constructor for the CacheElement object
CacheElement(java.lang.String cacheName, java.io.Serializable key, java.io.Serializable val, IElementAttributes attrArg)
          Constructor for the CacheElement object
 
Method Summary
 java.lang.String getCacheName()
          Gets the cacheName attribute of the CacheElement object
 IElementAttributes getElementAttributes()
          Gets the IElementAttributes attribute of the CacheElement object
 java.io.Serializable getKey()
          Gets the key attribute of the CacheElement object
 java.io.Serializable getVal()
          Gets the val attribute of the CacheElement object
 int hashCode()
           
 void setElementAttributes(IElementAttributes attr)
          Sets the attributes attribute of the CacheElement object
 java.lang.String toString()
          For debugging only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cacheName

public final java.lang.String cacheName
The name of the cache region. This is a namespace.


key

public final java.io.Serializable key
This is the cache key by which the value can be referenced.


val

public final java.io.Serializable val
This is the cached value, reference by the key.


attr

public IElementAttributes attr
These attributes hold information about the element and what it is allowed to do.

Constructor Detail

CacheElement

public CacheElement(java.lang.String cacheName,
                    java.io.Serializable key,
                    java.io.Serializable val)
Constructor for the CacheElement object

Parameters:
cacheName -
key -
val -

CacheElement

public CacheElement(java.lang.String cacheName,
                    java.io.Serializable key,
                    java.io.Serializable val,
                    IElementAttributes attrArg)
Constructor for the CacheElement object

Parameters:
cacheName -
key -
val -
attrArg -

CacheElement

public CacheElement(java.lang.String cacheName,
                    java.io.Serializable key,
                    java.lang.Object val)
Constructor for the CacheElement object

Parameters:
cacheName -
key -
val -
Method Detail

getCacheName

public java.lang.String getCacheName()
Gets the cacheName attribute of the CacheElement object

Specified by:
getCacheName in interface ICacheElement
Returns:
The cacheName value

getKey

public java.io.Serializable getKey()
Gets the key attribute of the CacheElement object

Specified by:
getKey in interface ICacheElement
Returns:
The key value

getVal

public java.io.Serializable getVal()
Gets the val attribute of the CacheElement object

Specified by:
getVal in interface ICacheElement
Returns:
The val value

setElementAttributes

public void setElementAttributes(IElementAttributes attr)
Sets the attributes attribute of the CacheElement object

Specified by:
setElementAttributes in interface ICacheElement
Parameters:
attr - The new IElementAttributes value

getElementAttributes

public IElementAttributes getElementAttributes()
Gets the IElementAttributes attribute of the CacheElement object

Specified by:
getElementAttributes in interface ICacheElement
Returns:
The IElementAttributes value, never null

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
a hash of the key only

toString

public java.lang.String toString()
For debugging only.

Overrides:
toString in class java.lang.Object
Returns:
String representation


Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.