Package openllet.core.tableau.cache
Class ConceptCacheLRU
- java.lang.Object
-
- openllet.core.tableau.cache.AbstractConceptCache
-
- openllet.core.tableau.cache.ConceptCacheLRU
-
- All Implemented Interfaces:
java.util.Map<openllet.aterm.ATermAppl,CachedNode>
,ConceptCache
public class ConceptCacheLRU extends AbstractConceptCache
Description: Least Recently Used implementation of ConceptCache. Primitive concepts and their negation are always kept in the cache. The least recently used complex concept will be removed from the cache if the max size is reached.
Copyright: Copyright (c) 2007
Company: Clark & Parsia, LLC.
- Author:
- Ron Alford
-
-
Field Summary
-
Fields inherited from class openllet.core.tableau.cache.AbstractConceptCache
_logger
-
-
Constructor Summary
Constructors Constructor Description ConceptCacheLRU(KnowledgeBase kb)
Creates an empty ConceptCacheImpl with no size restrictions Using this constructor is equivalent to break the auto-flush LRU policy of this cache.ConceptCacheLRU(KnowledgeBase kb, int maxSize)
Creates an empty _cache with at mostmaxSize
elements which are neither named or negations of names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<openllet.aterm.ATermAppl,CachedNode>>
entrySet()
CachedNode
get(java.lang.Object key)
CacheSafety
getSafety()
Returns safety checker that tells which concepts are safe to _cache.boolean
isEmpty()
java.util.Set<openllet.aterm.ATermAppl>
keySet()
CachedNode
put(openllet.aterm.ATermAppl key, CachedNode value)
key can't be null, value can't be null.void
putAll(java.util.Map<? extends openllet.aterm.ATermAppl,? extends CachedNode> t)
CachedNode
remove(java.lang.Object key)
int
size()
java.lang.String
toString()
java.util.Collection<CachedNode>
values()
-
Methods inherited from class openllet.core.tableau.cache.AbstractConceptCache
checkNominalEdges, getMaxSize, getSat, isMergable, putSat, setMaxSize
-
-
-
-
Constructor Detail
-
ConceptCacheLRU
public ConceptCacheLRU(KnowledgeBase kb)
Creates an empty ConceptCacheImpl with no size restrictions Using this constructor is equivalent to break the auto-flush LRU policy of this cache.- Parameters:
kb
-
-
ConceptCacheLRU
public ConceptCacheLRU(KnowledgeBase kb, int maxSize)
Creates an empty _cache with at mostmaxSize
elements which are neither named or negations of names.- Parameters:
kb
-maxSize
-
-
-
Method Detail
-
getSafety
public CacheSafety getSafety()
Description copied from interface:ConceptCache
Returns safety checker that tells which concepts are safe to _cache.- Returns:
- safety checker
-
clear
public void clear()
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
entrySet
public java.util.Set<java.util.Map.Entry<openllet.aterm.ATermAppl,CachedNode>> entrySet()
-
get
public CachedNode get(java.lang.Object key)
-
isEmpty
public boolean isEmpty()
-
keySet
public java.util.Set<openllet.aterm.ATermAppl> keySet()
-
put
public CachedNode put(openllet.aterm.ATermAppl key, CachedNode value)
key can't be null, value can't be null.
-
putAll
public void putAll(java.util.Map<? extends openllet.aterm.ATermAppl,? extends CachedNode> t)
-
remove
public CachedNode remove(java.lang.Object key)
-
size
public int size()
-
values
public java.util.Collection<CachedNode> values()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-