All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class ORG.opengroup.misc.Cache

java.lang.Object
    |
    +----java.lang.Thread
            |
            +----ORG.opengroup.misc.Cache

public class Cache
extends Thread
This object is used for timing purposes. It keeps a list of the objects to be times


Constructor Index

 o Cache(long, int)

Method Index

 o add(Cachable)
Adds the object which needs a timer to the Cache
 o getEntries()
Return the current number of entries of the cache.
 o getTime()
Returns the current time
 o remove(Cachable)
Removes an object which needs a timer
 o reschedule(Cachable)
Reschedules an object which needs a timer
 o run()
Performs timing operations

Constructors

 o Cache
public Cache(long granularity,
             int extent)
Parameters:
granularity - length of sleep of Cache.
extend - size of Cache array.

Methods

 o getTime
public long getTime()
Returns the current time

 o run
public void run()
Performs timing operations

Overrides:
run in class Thread
 o add
public void add(Cachable c)
Adds the object which needs a timer to the Cache

Parameters:
c - the object to be timed
 o reschedule
public void reschedule(Cachable c)
Reschedules an object which needs a timer

Parameters:
c - the object to be timed
 o remove
public void remove(Cachable c)
Removes an object which needs a timer

Parameters:
c - the Cachable object to be removed
 o getEntries
public int getEntries()
Return the current number of entries of the cache. Even though the entries is maintained in the Cache object, it is up to the object that adds/removes entries to act upon this information.


All Packages  Class Hierarchy  This Package  Previous  Next  Index