net.dontdrinkandroot.cache.metadata.impl
Class SimpleMetaData

java.lang.Object
  extended by net.dontdrinkandroot.cache.metadata.impl.SimpleMetaData
All Implemented Interfaces:
Serializable, MetaData

public class SimpleMetaData
extends Object
implements MetaData

Author:
Philip W. Sorst
See Also:
Serialized Form

Constructor Summary
SimpleMetaData(long expiry)
           
SimpleMetaData(long created, long expiry)
           
SimpleMetaData(long created, long expiry, long maxIdleTime)
           
 
Method Summary
 long getCreated()
          Get the timestamp when the entry was created.
 long getExpiry()
          Get the timestamp when the entry expires.
 long getHitCount()
          Get the number of hits.
 long getLastAccess()
          Get the timestamp when the entry was last accessed.
 long getMaxIdleTime()
          Get the maximum time that the entry may idle (not being accessed) before being evicted (in milliseconds).
 void increaseCount()
           
 boolean isExpired()
          Check if the entry is expired.
 boolean isIdledAway()
          Check if the entry has not been accessed within the idle period.
 void resetCount()
           
 void setCount(int count)
           
 void setLastAccess(long lastAccess)
           
 void update()
          Update the entry after a cache hit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMetaData

public SimpleMetaData(long expiry)

SimpleMetaData

public SimpleMetaData(long created,
                      long expiry)

SimpleMetaData

public SimpleMetaData(long created,
                      long expiry,
                      long maxIdleTime)
Method Detail

getExpiry

public final long getExpiry()
Description copied from interface: MetaData
Get the timestamp when the entry expires.

Specified by:
getExpiry in interface MetaData

update

public final void update()
Description copied from interface: MetaData
Update the entry after a cache hit.

Specified by:
update in interface MetaData

getLastAccess

public final long getLastAccess()
Description copied from interface: MetaData
Get the timestamp when the entry was last accessed.

Specified by:
getLastAccess in interface MetaData

getHitCount

public final long getHitCount()
Description copied from interface: MetaData
Get the number of hits.

Specified by:
getHitCount in interface MetaData

isExpired

public boolean isExpired()
Description copied from interface: MetaData
Check if the entry is expired.

Specified by:
isExpired in interface MetaData

getCreated

public long getCreated()
Description copied from interface: MetaData
Get the timestamp when the entry was created.

Specified by:
getCreated in interface MetaData

isIdledAway

public boolean isIdledAway()
Description copied from interface: MetaData
Check if the entry has not been accessed within the idle period.

Specified by:
isIdledAway in interface MetaData

getMaxIdleTime

public long getMaxIdleTime()
Description copied from interface: MetaData
Get the maximum time that the entry may idle (not being accessed) before being evicted (in milliseconds).

Specified by:
getMaxIdleTime in interface MetaData

setCount

public final void setCount(int count)

setLastAccess

public final void setLastAccess(long lastAccess)

resetCount

public final void resetCount()

increaseCount

public final void increaseCount()


Copyright © 2013 dontdrinkandroot. All Rights Reserved.