public class ConceptCacheLRU extends AbstractConceptCache implements ConceptCache
Title:
Description: LRU 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.
log| Constructor and Description |
|---|
ConceptCacheLRU(KnowledgeBase kb)
Creates an empty ConceptCacheImpl with no size restrictions
|
ConceptCacheLRU(KnowledgeBase kb,
int maxSize)
Creates an empty cache with at most
maxSize elements which
are neither named or negations of names. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<aterm.ATermAppl,CachedNode>> |
entrySet() |
CachedNode |
get(Object key) |
CacheSafety |
getSafety()
Returns safety checker that tells which concepts are safe to cache.
|
boolean |
isEmpty() |
Set<aterm.ATermAppl> |
keySet() |
CachedNode |
put(aterm.ATermAppl key,
CachedNode value) |
void |
putAll(Map<? extends aterm.ATermAppl,? extends CachedNode> t) |
CachedNode |
remove(Object key) |
int |
size() |
String |
toString() |
Collection<CachedNode> |
values() |
checkNominalEdges, getMaxSize, getSat, isFull, isMergable, putSat, setMaxSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcheckNominalEdges, getMaxSize, getSat, isMergable, putSat, setMaxSizecompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic ConceptCacheLRU(KnowledgeBase kb)
maxSize - public ConceptCacheLRU(KnowledgeBase kb, int maxSize)
maxSize elements which
are neither named or negations of names.maxSize - public CacheSafety getSafety()
ConceptCachegetSafety in interface ConceptCachepublic void clear()
clear in interface Map<aterm.ATermAppl,CachedNode>public boolean containsKey(Object key)
containsKey in interface Map<aterm.ATermAppl,CachedNode>public boolean containsValue(Object value)
containsValue in interface Map<aterm.ATermAppl,CachedNode>public Set<Map.Entry<aterm.ATermAppl,CachedNode>> entrySet()
entrySet in interface Map<aterm.ATermAppl,CachedNode>public CachedNode get(Object key)
get in interface Map<aterm.ATermAppl,CachedNode>public boolean isEmpty()
isEmpty in interface Map<aterm.ATermAppl,CachedNode>public Set<aterm.ATermAppl> keySet()
keySet in interface Map<aterm.ATermAppl,CachedNode>public CachedNode put(aterm.ATermAppl key, CachedNode value)
put in interface Map<aterm.ATermAppl,CachedNode>public void putAll(Map<? extends aterm.ATermAppl,? extends CachedNode> t)
putAll in interface Map<aterm.ATermAppl,CachedNode>public CachedNode remove(Object key)
remove in interface Map<aterm.ATermAppl,CachedNode>public int size()
size in interface Map<aterm.ATermAppl,CachedNode>public Collection<CachedNode> values()
values in interface Map<aterm.ATermAppl,CachedNode>Copyright © 2019. All rights reserved.