com.bigdata.cache
Class WeakCacheEntry<K,T>

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.WeakReference<T>
          extended by com.bigdata.cache.WeakCacheEntry<K,T>
All Implemented Interfaces:
IWeakRefCacheEntry<K,T>

public class WeakCacheEntry<K,T>
extends WeakReference<T>
implements IWeakRefCacheEntry<K,T>

Implementation based on WeakReference.

Version:
$Id: WeakCacheEntry.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
thompsonbry

Constructor Summary
WeakCacheEntry(K key, T obj, ReferenceQueue<T> queue)
           
 
Method Summary
 K getKey()
          Returns the key for the object stored in the cache entry.
 T getObject()
          The object in the cache.
 String toString()
           
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeakCacheEntry

public WeakCacheEntry(K key,
                      T obj,
                      ReferenceQueue<T> queue)
Method Detail

getKey

public K getKey()
Description copied from interface: IWeakRefCacheEntry
Returns the key for the object stored in the cache entry. This is generally an object identifier (OID).

Specified by:
getKey in interface IWeakRefCacheEntry<K,T>

getObject

public T getObject()
Description copied from interface: IWeakRefCacheEntry
The object in the cache. If the entry belongs to a weak reference cache, then this method returns the weak referent or null iff the weak reference has been cleared.

Specified by:
getObject in interface IWeakRefCacheEntry<K,T>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.