org.activemath.content.mediator
Class QueryCache

java.lang.Object
  extended by org.activemath.content.mediator.QueryCache
All Implemented Interfaces:
CacheControl

public class QueryCache
extends Object
implements CacheControl

A Cache for storing the result set of queries posed to the mediator.


Field Summary
static String CACHE_ID
           
 
Constructor Summary
QueryCache()
           
 
Method Summary
 boolean add(KBQuery query, Set result)
          Adds an entry to the cacheForExpandedQueries.
 boolean addInIncomingCache(KBQuery query, Set result)
           
 void clear()
           
 Set get(KBQuery query)
          Returns the resulting items of the given query.
 CacheInfo getCacheInfo()
           
 CacheInfo getCacheInfo2()
           
 Set getFromIncomingCache(KBQuery query)
           
static QueryCache getInstance()
           
 void remove(String string)
          Not implemented
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CACHE_ID

public static final String CACHE_ID
See Also:
Constant Field Values
Constructor Detail

QueryCache

public QueryCache()
Method Detail

getInstance

public static QueryCache getInstance()

get

public Set get(KBQuery query)
Returns the resulting items of the given query.

Parameters:
kbQuery -
Returns:
The Set of items corresponding to the given query. If there is no such query in the cacheForExpandedQueries, null is returned.

getFromIncomingCache

public Set getFromIncomingCache(KBQuery query)

add

public boolean add(KBQuery query,
                   Set result)
Adds an entry to the cacheForExpandedQueries.

Parameters:
kbQuery -
result -
Returns:
true if the entry is stored, false otherwise

addInIncomingCache

public boolean addInIncomingCache(KBQuery query,
                                  Set result)

toString

public String toString()
Overrides:
toString in class Object

remove

public void remove(String string)
Not implemented

Specified by:
remove in interface CacheControl
See Also:
CacheControl.remove(java.lang.String)

clear

public void clear()
Specified by:
clear in interface CacheControl
See Also:
CacheControl.clear()

getCacheInfo

public CacheInfo getCacheInfo()
Specified by:
getCacheInfo in interface CacheControl
See Also:
CacheControl.getCacheInfo()

getCacheInfo2

public CacheInfo getCacheInfo2()