net.spy.factory
Class HashCacheEntry

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.factory.HashCacheEntry
All Implemented Interfaces:
CacheEntry

public class HashCacheEntry
extends SpyObject
implements CacheEntry

An implementation of CacheEntry that is backed by a HashMap.


Constructor Summary
HashCacheEntry()
          Get an instance of HashCacheEntry.
 
Method Summary
 void cacheInstance(Instance i)
          Cache this instance.
 java.util.Collection getAllObjects()
          Get all of the objects in this cache.
 java.lang.Object getById(int id)
          Get the object at this ID.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashCacheEntry

public HashCacheEntry()
Get an instance of HashCacheEntry.

Method Detail

cacheInstance

public void cacheInstance(Instance i)
Cache this instance.

Specified by:
cacheInstance in interface CacheEntry

getById

public java.lang.Object getById(int id)
Get the object at this ID.

Specified by:
getById in interface CacheEntry
Parameters:
id - the object ID
Returns:
the object, or null if there's no object by this ID

getAllObjects

public java.util.Collection getAllObjects()
Get all of the objects in this cache.

Specified by:
getAllObjects in interface CacheEntry
Returns:
an unmodifiable collection of object instances


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.