anthill.storage.impl
Class LRUQueryStorage

java.lang.Object
  |
  +--anthill.storage.impl.LRUKeyStorage
        |
        +--anthill.storage.impl.LRUQueryStorage
All Implemented Interfaces:
Clearable, GenericStorage, QueryStorage, ResourceManager, Storage
Direct Known Subclasses:
UrlStorage, UrlStorage

public class LRUQueryStorage
extends LRUKeyStorage
implements QueryStorage

Implementation of an LRU based query storage. This is a wrapper class for storing resources based on using a query to access the resources. It inherits all methods from the LRUKeyStorage, but adds a method to retrieve resources based on a query.

Version:
$Revision: 1.6 $
Author:
Hein Meling

Field Summary
static String PAR_CONTROLLERNAME
          The identifier of the configuration parameter
 
Fields inherited from class anthill.storage.impl.LRUKeyStorage
factory, list, name, PAR_STORAGENAME, storage
 
Fields inherited from interface anthill.storage.Storage
DOC_STORAGE, PHR_STORAGE, URL_STORAGE
 
Constructor Summary
LRUQueryStorage(Factory factory, String name)
           
 
Method Summary
 void clear()
          Restore the object to its initial state
 Resource[] getResources(Object query)
          Return the resource associated with the specified query.
 
Methods inherited from class anthill.storage.impl.LRUKeyStorage
addResource, containsResource, getCapacity, getRemainingCapacity, getResource, iterator, removeResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anthill.storage.GenericStorage
addResource, containsResource, getCapacity, getRemainingCapacity, getResource, iterator, removeResource
 

Field Detail

PAR_CONTROLLERNAME

public static final String PAR_CONTROLLERNAME
The identifier of the configuration parameter

See Also:
Constant Field Values
Constructor Detail

LRUQueryStorage

public LRUQueryStorage(Factory factory,
                       String name)
Parameters:
factory - the factory to be used to read configuration arguments and to create other configurable objects
name - the name that is associated to this instance in the configuration file
Method Detail

clear

public void clear()
Restore the object to its initial state

Specified by:
clear in interface Clearable
Overrides:
clear in class LRUKeyStorage

getResources

public Resource[] getResources(Object query)
Return the resource associated with the specified query.

Specified by:
getResources in interface QueryStorage
Parameters:
query - whose associated resource to retreive.
Returns:
resources found in the storage with which the specified query matched.