Protege 3.3.1

edu.stanford.smi.protege.model.framestore
Class ClosureCachingBasicFrameStore

java.lang.Object
  extended by edu.stanford.smi.protege.model.framestore.ClosureCachingBasicFrameStore
All Implemented Interfaces:
NarrowFrameStore

public class ClosureCachingBasicFrameStore
extends Object
implements NarrowFrameStore

Author:
Ray Fergerson Description of this class

Constructor Summary
ClosureCachingBasicFrameStore(NarrowFrameStore delegate)
           
 
Method Summary
 void addValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 boolean beginTransaction(String name)
           
 void close()
           
 boolean commitTransaction()
           
 void deleteFrame(Frame frame)
           
static boolean equals(Object o1, Object o2)
           
 void executeQuery(Query query, QueryCallback callback)
          The executeQuery method allows for complex queries.
 FrameID generateFrameID()
           
 Set getClosure(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 int getClsCount()
           
 NarrowFrameStore getDelegate()
           
 int getFacetCount()
           
 Frame getFrame(FrameID id)
           
 int getFrameCount()
           
 Set getFrames()
           
 Set getFrames(Slot slot, Facet facet, boolean isTemplate, Object value)
           
 Set getFramesWithAnyValue(Slot slot, Facet facet, boolean isTemplate)
           
 Set getMatchingFrames(Slot slot, Facet facet, boolean isTemplate, String value, int maxMatches)
           
 Set getMatchingReferences(String value, int maxMatches)
           
 String getName()
          The Narrow Frame store has a standard set/get name interface.
 Set getReferences(Object value)
           
 int getSimpleInstanceCount()
           
 int getSlotCount()
           
 TransactionMonitor getTransactionStatusMonitor()
          Retrieves a transaction status monitor for transactions.
 List getValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
          Obtains the values of a slot/facet to a frame.
 int getValuesCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int from, int to)
          Retrieves the list of values associated with the (frame, slot, facet, isTemplate) combination and moves the item at the position from to the position to.
 void removeValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void replaceFrame(Frame frame)
          A complete hack to work around problems with the java packages feature
 boolean rollbackTransaction()
           
 void setName(String name)
          The Narrow Frame store has a standard set/get name interface.
 void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosureCachingBasicFrameStore

public ClosureCachingBasicFrameStore(NarrowFrameStore delegate)
Method Detail

getName

public String getName()
Description copied from interface: NarrowFrameStore
The Narrow Frame store has a standard set/get name interface. One of the purposes of this interface is to allow the MergingNarrowFrameStore match names of the narrow frame stores of including and included projects. For this purpose the name of the narrow frame store is the string representation of the uri for the project.

Specified by:
getName in interface NarrowFrameStore
Returns:
the name of this narrow frame store.

setName

public void setName(String name)
Description copied from interface: NarrowFrameStore
The Narrow Frame store has a standard set/get name interface. One of the purposes of this interface is to allow the MergingNarrowFrameStore match names of the narrow frame stores of including and included projects. For this purpose the name of the narrow frame store is the string representation of the uri for the project.

Specified by:
setName in interface NarrowFrameStore
Parameters:
name - - the name of the Narrow Frame Store.

getDelegate

public NarrowFrameStore getDelegate()
Specified by:
getDelegate in interface NarrowFrameStore

getFrame

public Frame getFrame(FrameID id)
Specified by:
getFrame in interface NarrowFrameStore

generateFrameID

public FrameID generateFrameID()
Specified by:
generateFrameID in interface NarrowFrameStore

getValues

public List getValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate)
Description copied from interface: NarrowFrameStore
Obtains the values of a slot/facet to a frame. It consists of a list of Strings, Integers Floats and Frames. This call does one of several things. If facet == null then we are looking at a slot value. In this case, if isTemplate is true, then the frame is a class, the slot is a template slot and the value is a default facet value. If facet != null then we are looking at a facet value. In this case, if isTemplate is true then the frame is a class, the slot is a template slot and the value is a default facet value.

Specified by:
getValues in interface NarrowFrameStore
Parameters:
frame - - the frame
slot - the slot
facet - the facet. If this is non-null then we are looking at a facet value.
isTemplate - to be determined
Returns:
a list of the values of the slot of the frame.

getValuesCount

public int getValuesCount(Frame frame,
                          Slot slot,
                          Facet facet,
                          boolean isTemplate)
Specified by:
getValuesCount in interface NarrowFrameStore

setValues

public void setValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Collection values)
Specified by:
setValues in interface NarrowFrameStore

addValues

public void addValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Collection values)
Specified by:
addValues in interface NarrowFrameStore

removeValue

public void removeValue(Frame frame,
                        Slot slot,
                        Facet facet,
                        boolean isTemplate,
                        Object value)
Specified by:
removeValue in interface NarrowFrameStore

moveValue

public void moveValue(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      int from,
                      int to)
Description copied from interface: NarrowFrameStore
Retrieves the list of values associated with the (frame, slot, facet, isTemplate) combination and moves the item at the position from to the position to. Indexing is done starting from 0.

Specified by:
moveValue in interface NarrowFrameStore
Parameters:
frame - the frame (as used in getValues)
slot - the slot (as used in getValues)
facet - the facet (as used in getValues)
isTemplate - whether it is a template (as used in getValues)
from - the starting position of a value
to - the position of the value after this call

getFrames

public Set getFrames(Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
Specified by:
getFrames in interface NarrowFrameStore

getFramesWithAnyValue

public Set getFramesWithAnyValue(Slot slot,
                                 Facet facet,
                                 boolean isTemplate)
Specified by:
getFramesWithAnyValue in interface NarrowFrameStore

getFrameCount

public int getFrameCount()
Specified by:
getFrameCount in interface NarrowFrameStore

getClsCount

public int getClsCount()
Specified by:
getClsCount in interface NarrowFrameStore

getSlotCount

public int getSlotCount()
Specified by:
getSlotCount in interface NarrowFrameStore

getFacetCount

public int getFacetCount()
Specified by:
getFacetCount in interface NarrowFrameStore

getSimpleInstanceCount

public int getSimpleInstanceCount()
Specified by:
getSimpleInstanceCount in interface NarrowFrameStore

getFrames

public Set getFrames()
Specified by:
getFrames in interface NarrowFrameStore

getMatchingFrames

public Set getMatchingFrames(Slot slot,
                             Facet facet,
                             boolean isTemplate,
                             String value,
                             int maxMatches)
Specified by:
getMatchingFrames in interface NarrowFrameStore
Parameters:
slot - the slot
facet - the facet
isTemplate - whether we are looking at template values
value - the regexp to use for matching
maxMatches - the max number of matches (-1 for get all)
Returns:
See Also:
KnowledgeBase.getMatchingFrames

getReferences

public Set getReferences(Object value)
Specified by:
getReferences in interface NarrowFrameStore

getMatchingReferences

public Set getMatchingReferences(String value,
                                 int maxMatches)
Specified by:
getMatchingReferences in interface NarrowFrameStore

deleteFrame

public void deleteFrame(Frame frame)
Specified by:
deleteFrame in interface NarrowFrameStore

executeQuery

public void executeQuery(Query query,
                         QueryCallback callback)
Description copied from interface: NarrowFrameStore
The executeQuery method allows for complex queries. It is asynchronous so that in server-client mode the server knowledge base lock will not be held for an excessive amount of time. The contract specifies that the implementor must call one of the QueryCallback methods in a separate thread. This makes it possible for the caller to know how to retrieve the results in a synchronous way without worrying about deadlock.

Specified by:
executeQuery in interface NarrowFrameStore

close

public void close()
Specified by:
close in interface NarrowFrameStore

getClosure

public Set getClosure(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate)
Specified by:
getClosure in interface NarrowFrameStore

beginTransaction

public boolean beginTransaction(String name)
Specified by:
beginTransaction in interface NarrowFrameStore

commitTransaction

public boolean commitTransaction()
Specified by:
commitTransaction in interface NarrowFrameStore

rollbackTransaction

public boolean rollbackTransaction()
Specified by:
rollbackTransaction in interface NarrowFrameStore

getTransactionStatusMonitor

public TransactionMonitor getTransactionStatusMonitor()
Description copied from interface: NarrowFrameStore
Retrieves a transaction status monitor for transactions. If this call returns null then it means that transactions are not supported.

Specified by:
getTransactionStatusMonitor in interface NarrowFrameStore
Returns:
A TransactionMonitor object that tracks the status of transactions.

replaceFrame

public void replaceFrame(Frame frame)
Description copied from interface: NarrowFrameStore
A complete hack to work around problems with the java packages feature

Specified by:
replaceFrame in interface NarrowFrameStore

equals

public static boolean equals(Object o1,
                             Object o2)

Protege 3.3.1

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2007 Stanford University.