IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class CacheElement

java.lang.Object
  extended by com.ibm.btt.base.CacheElement

public class CacheElement
extends java.lang.Object

This class implements a structure to store elements into the cache table. This structure wraps to kinds of objects. On one hand it contains a Vector to store the objects to get and put into the cache table, for example operations, and on the other hand it contains a linked list containing a long corresponding to the current time when an object is inserted. When an object is requested for an adding or removing operation, the target cached object will be the last object of the vector, and its corresponding element of the linked list will be the first element of the structure.


Field Summary
protected  Vector cachedObjects
           
protected  long newestTime
           
protected  LinkedList objectTimestamp
           
 
Constructor Summary
CacheElement()
          CacheElement default constructor.
 
Method Summary
 void addElement(Cacheable c)
          Adds an element into the structure.
 Cacheable getCacheable()
          Returns the last element of the cacheObjects Vector.
 Vector getCachedObjects()
          Returns the cachedObjects.
 long getNewestTime()
          Returns the time corresponding to the newest element stored in the list
 LinkedList getObjectTimestamp()
          Returns the objectTimestamp.
 long getOldestTime()
          Returns the time corresponding to the oldest element stored in the list
 int getSize()
          Returns the number of objects contained in the cacheObjects Vector.
 void removeOldest()
          Removes the oldest element of the structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedObjects

protected Vector cachedObjects

objectTimestamp

protected LinkedList objectTimestamp

newestTime

protected long newestTime
Constructor Detail

CacheElement

public CacheElement()
CacheElement default constructor.

Method Detail

getOldestTime

public long getOldestTime()
Returns the time corresponding to the oldest element stored in the list

Returns:
long

getNewestTime

public long getNewestTime()
Returns the time corresponding to the newest element stored in the list

Returns:
long

removeOldest

public void removeOldest()
Removes the oldest element of the structure.


addElement

public void addElement(Cacheable c)
Adds an element into the structure.

Parameters:
c - Cacheable Cacheable object to append.

getSize

public int getSize()
Returns the number of objects contained in the cacheObjects Vector.


getCacheable

public Cacheable getCacheable()
Returns the last element of the cacheObjects Vector.


getCachedObjects

public Vector getCachedObjects()
Returns the cachedObjects.

Returns:
Vector

getObjectTimestamp

public LinkedList getObjectTimestamp()
Returns the objectTimestamp.

Returns:
LinkedList

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009