wt.occurrence
Class OccurrenceCountCache

java.lang.Object
  extended bywt.occurrence.OccurrenceCountCache

public class OccurrenceCountCache
extends Object


Nested Class Summary
protected  class OccurrenceCountCache.Count
           
 
Field Summary
private  HashSet contexts
           
private  HashMap counts
           
private  Class occurrenceClass
           
 
Constructor Summary
OccurrenceCountCache(Class occurrenceClass)
           
 
Method Summary
 void decrementCount(ObjectIdentifier contextID, ObjectIdentifier linkID, int decrement)
           
 void decrementCount(OccurrenceableLink link, int decrement)
           
protected  ObjectIdentifier getContextID(OccurrenceableLink link)
           
 int getCount(OccurrenceableLink link)
           
static OccurrenceCountCache getCountCache(String cacheName, Class _class)
          Given the name of an occurrence cache, retrieves it from the method context.
protected  ObjectIdentifier getLinkID(UsesOccurrence occurrence)
           
protected  QueryResult getUsesOccurrences(ObjectIdentifier contextID)
           
 void incrementCount(OccurrenceableLink link, int increment)
           
protected  void updateCounts(ObjectIdentifier contextID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contexts

private HashSet contexts

counts

private HashMap counts

occurrenceClass

private Class occurrenceClass
Constructor Detail

OccurrenceCountCache

public OccurrenceCountCache(Class occurrenceClass)
Method Detail

getCountCache

public static OccurrenceCountCache getCountCache(String cacheName,
                                                 Class _class)
Given the name of an occurrence cache, retrieves it from the method context. If a cache by that name does not exist, this method will create it and add it to the method context.


getCount

public int getCount(OccurrenceableLink link)
             throws WTException
Throws:
WTException

incrementCount

public void incrementCount(OccurrenceableLink link,
                           int increment)
                    throws WTException
Throws:
WTException

decrementCount

public void decrementCount(OccurrenceableLink link,
                           int decrement)
                    throws WTException
Throws:
WTException

decrementCount

public void decrementCount(ObjectIdentifier contextID,
                           ObjectIdentifier linkID,
                           int decrement)
                    throws WTException
Throws:
WTException

updateCounts

protected void updateCounts(ObjectIdentifier contextID)
                     throws WTException
Throws:
WTException

getUsesOccurrences

protected QueryResult getUsesOccurrences(ObjectIdentifier contextID)
                                  throws WTException
Throws:
WTException

getContextID

protected ObjectIdentifier getContextID(OccurrenceableLink link)

getLinkID

protected ObjectIdentifier getLinkID(UsesOccurrence occurrence)