intarsys runtime library

de.intarsys.tools.cache
Class CacheEntry

java.lang.Object
  extended by de.intarsys.tools.cache.CacheEntry
All Implemented Interfaces:
Comparable

public class CacheEntry
extends Object
implements Comparable

An entry in the cache implementation.

A cache entries "importance" is expressed by a "sample". The CacheEntry with the smallest sample is considered the least valuable.

This implementation supports a simple "most recently used" strategy.


Method Summary
 int compareTo(Object o)
           
 Object getKey()
          The key of the cache entry.
 int getSample()
          The sample representing the "importance" of the entry.
 Object getValue()
          The value of the cache entry.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getKey

public Object getKey()
The key of the cache entry.

Returns:
Returns the key.

getSample

public int getSample()
The sample representing the "importance" of the entry.

Returns:
Returns the sample.

getValue

public Object getValue()
The value of the cache entry.

Returns:
Returns the value.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.