org.nees.util.cache
Class CachedObject

java.lang.Object
  extended byorg.nees.util.cache.CachedObject
All Implemented Interfaces:
Multisortable

public class CachedObject
extends java.lang.Object
implements Multisortable

Creation timestamp: Feb 20, 2003 9:21:12 AM

Author:
jeff

Field Summary
 
Fields inherited from interface org.nees.util.cache.Multisortable
EQUAL_TO, GREATER_THAN, INCOMPARABLE, LESS_THAN
 
Constructor Summary
CachedObject(java.lang.Object key, java.lang.Object cachedObject)
           
 
Method Summary
 int compareTo(int key, CachedObject co)
           
 int compareTo(int key, Multisortable ms)
           
 boolean equals(java.lang.Object obj)
           
 long getByteSize()
           
 java.util.Date getCreationTime()
          Returns the creationTime.
 java.lang.Object getHashKey()
          Returns the hashKey.
 java.util.Date getLastAccessedTime()
          Returns the lastAccessedTime.
 int getNumberOfAccesses()
          Returns the numberOfAccesses.
 java.lang.Object getObject()
          Returns the object.
 int hashCode()
           
protected  void setCreationTime(java.util.Date creationTime)
          Sets the creationTime.
protected  void setHashKey(java.lang.Object hashKey)
          Sets the hashKey.
protected  void setLastAccessedTime(java.util.Date lastAccessedTime)
          Sets the lastAccessedTime.
 void setNumberOfAccesses(int numberOfAccesses)
          Sets the numberOfAccesses.
protected  void setObject(java.lang.Object object)
          Sets the object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachedObject

public CachedObject(java.lang.Object key,
                    java.lang.Object cachedObject)
Method Detail

getCreationTime

public java.util.Date getCreationTime()
Returns the creationTime.

Returns:
Date

equals

public boolean equals(java.lang.Object obj)

getHashKey

public java.lang.Object getHashKey()
Returns the hashKey.

Returns:
Object

hashCode

public int hashCode()

getLastAccessedTime

public java.util.Date getLastAccessedTime()
Returns the lastAccessedTime.

Returns:
Date

compareTo

public int compareTo(int key,
                     Multisortable ms)
Specified by:
compareTo in interface Multisortable

compareTo

public int compareTo(int key,
                     CachedObject co)

getByteSize

public long getByteSize()

getObject

public java.lang.Object getObject()
Returns the object.

Returns:
Object

setCreationTime

protected void setCreationTime(java.util.Date creationTime)
Sets the creationTime.

Parameters:
creationTime - The creationTime to set

setHashKey

protected void setHashKey(java.lang.Object hashKey)
Sets the hashKey.

Parameters:
hashKey - The hashKey to set

setLastAccessedTime

protected void setLastAccessedTime(java.util.Date lastAccessedTime)
Sets the lastAccessedTime.

Parameters:
lastAccessedTime - The lastAccessedTime to set

setObject

protected void setObject(java.lang.Object object)
Sets the object.

Parameters:
object - The object to set

toString

public java.lang.String toString()

getNumberOfAccesses

public int getNumberOfAccesses()
Returns the numberOfAccesses.

Returns:
int

setNumberOfAccesses

public void setNumberOfAccesses(int numberOfAccesses)
Sets the numberOfAccesses.

Parameters:
numberOfAccesses - The numberOfAccesses to set