common-util

local.tomas.util.cache
Class CacheItem<K,V>

java.lang.Object
  extended by local.tomas.util.cache.CacheItem<K,V>
Type Parameters:
K -
V -

public class CacheItem<K,V>
extends Object

Cache item.

Author:
tomas.teubner

Constructor Summary
CacheItem(K key, V value)
          Construct cache item from key and value
CacheItem(K key, V value, Date lastAccess)
          Construct cache item from key, value and time of last access.
 
Method Summary
 K getKey()
          Get item key.
 Date getLastAccess()
          Get time of last access.
 V getValue()
          Get item value.
 void setValue(V value)
          Set item value.
 void touch()
          Touch item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheItem

public CacheItem(K key,
                 V value,
                 Date lastAccess)
Construct cache item from key, value and time of last access.

Parameters:
key - the key
value - the value
lastAccess - time of last access

CacheItem

public CacheItem(K key,
                 V value)
Construct cache item from key and value

Parameters:
key - the key
value - the value
Method Detail

getValue

public V getValue()
Get item value.

Returns:
Returns the value.

setValue

public void setValue(V value)
Set item value.

Parameters:
value - The value to set.

getKey

public K getKey()
Get item key.

Returns:
Returns the key.

getLastAccess

public Date getLastAccess()
Get time of last access.

Returns:
Returns the lastAccess.

touch

public void touch()
Touch item. Set time of last access to current time.


common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.