org.mindswap.pellet.tableau.cache
Class ConceptCacheLRU

java.lang.Object
  extended by org.mindswap.pellet.tableau.cache.AbstractConceptCache
      extended by org.mindswap.pellet.tableau.cache.ConceptCacheLRU
All Implemented Interfaces:
java.util.Map<aterm.ATermAppl,CachedNode>, ConceptCache

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.

Author:
Ron Alford

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class org.mindswap.pellet.tableau.cache.AbstractConceptCache
log
 
Constructor Summary
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.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set<java.util.Map.Entry<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<aterm.ATermAppl> keySet()
           
 CachedNode put(aterm.ATermAppl key, CachedNode value)
           
 void putAll(java.util.Map<? extends 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 org.mindswap.pellet.tableau.cache.AbstractConceptCache
checkNominalEdges, getMaxSize, getSat, isMergable, putSat, setMaxSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mindswap.pellet.tableau.cache.ConceptCache
checkNominalEdges, getMaxSize, getSat, isMergable, putSat, setMaxSize
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ConceptCacheLRU

public ConceptCacheLRU(KnowledgeBase kb)
Creates an empty ConceptCacheImpl with no size restrictions

Parameters:
maxSize -

ConceptCacheLRU

public ConceptCacheLRU(KnowledgeBase kb,
                       int maxSize)
Creates an empty cache with at most maxSize elements which are neither named or negations of names.

Parameters:
maxSize -
Method Detail

getSafety

public CacheSafety getSafety()
Description copied from interface: ConceptCache
Returns safety checker that tells which concepts are safe to cache.

Specified by:
getSafety in interface ConceptCache
Returns:
safety checker

clear

public void clear()
Specified by:
clear in interface java.util.Map<aterm.ATermAppl,CachedNode>

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<aterm.ATermAppl,CachedNode>

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<aterm.ATermAppl,CachedNode>

entrySet

public java.util.Set<java.util.Map.Entry<aterm.ATermAppl,CachedNode>> entrySet()
Specified by:
entrySet in interface java.util.Map<aterm.ATermAppl,CachedNode>

get

public CachedNode get(java.lang.Object key)
Specified by:
get in interface java.util.Map<aterm.ATermAppl,CachedNode>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<aterm.ATermAppl,CachedNode>

keySet

public java.util.Set<aterm.ATermAppl> keySet()
Specified by:
keySet in interface java.util.Map<aterm.ATermAppl,CachedNode>

put

public CachedNode put(aterm.ATermAppl key,
                      CachedNode value)
Specified by:
put in interface java.util.Map<aterm.ATermAppl,CachedNode>

putAll

public void putAll(java.util.Map<? extends aterm.ATermAppl,? extends CachedNode> t)
Specified by:
putAll in interface java.util.Map<aterm.ATermAppl,CachedNode>

remove

public CachedNode remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map<aterm.ATermAppl,CachedNode>

size

public int size()
Specified by:
size in interface java.util.Map<aterm.ATermAppl,CachedNode>

values

public java.util.Collection<CachedNode> values()
Specified by:
values in interface java.util.Map<aterm.ATermAppl,CachedNode>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004 Evren Sirin. All Rights Reserved.