|
Protege 3.3.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protege.model.framestore.InMemoryFrameDbAlt
public class InMemoryFrameDbAlt
This is a version of the InMemoryFrameDb that helps support the OWL problem that frames may change their type in mid-parse. The idea of this class is that all Frames kept in this class are simply viewed as a cache. A call to flush() will efficiently invalidate all frames held in storage and cause them to be recalculated as needed. In addition, the type of a single frame can be updated and the cache for just that frame will be invalidated.
Constructor Summary | |
---|---|
InMemoryFrameDbAlt(String name)
|
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)
|
void |
executeQuery(Query query,
QueryCallback callback)
The executeQuery method allows for complex queries. |
void |
flush()
Flush all the cached frames in one quick operation. |
FrameID |
generateFrameID()
|
Set |
getClosure(Frame frame,
Slot slot,
Facet facet,
boolean isTemplate)
|
int |
getClsCount()
|
int |
getCountByType(int javaType)
|
NarrowFrameStore |
getDelegate()
|
int |
getFacetCount()
|
Frame |
getFrame(FrameID id)
|
int |
getFrameCount()
|
Set<Frame> |
getFrames()
|
Set<Frame> |
getFrames(Slot slot,
Facet facet,
boolean isTemplate,
Object value)
|
Set<Frame> |
getFramesWithAnyValue(Slot slot,
Facet facet,
boolean isTemplate)
|
Set<Frame> |
getMatchingFrames(Slot slot,
Facet facet,
boolean isTemplate,
String regexp,
int maxMatches)
|
Set<Reference> |
getMatchingReferences(String regexp,
int maxMatches)
|
String |
getName()
The Narrow Frame store has a standard set/get name interface. |
Set<Reference> |
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 |
setFrameFactory(FrameFactory ff)
This call sets the frame factory for this Narrow Frame Store so that it can create its own frames. |
void |
setJavaType(FrameID fid,
int javaType)
Set the javaType of the frame with frame id fid to javaType. |
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 |
---|
public InMemoryFrameDbAlt(String name)
Method Detail |
---|
public void setFrameFactory(FrameFactory ff)
ff
- the frame factory that this frame store uses to create frames.public void flush()
public void setJavaType(FrameID fid, int javaType)
fid
- the frame id of the framejavaType
- the new java type of the framepublic String getName()
NarrowFrameStore
getName
in interface NarrowFrameStore
public void setName(String name)
NarrowFrameStore
setName
in interface NarrowFrameStore
name
- - the name of the Narrow Frame Store.public NarrowFrameStore getDelegate()
getDelegate
in interface NarrowFrameStore
public FrameID generateFrameID()
generateFrameID
in interface NarrowFrameStore
public int getFrameCount()
getFrameCount
in interface NarrowFrameStore
public int getClsCount()
getClsCount
in interface NarrowFrameStore
public int getSlotCount()
getSlotCount
in interface NarrowFrameStore
public int getFacetCount()
getFacetCount
in interface NarrowFrameStore
public int getSimpleInstanceCount()
getSimpleInstanceCount
in interface NarrowFrameStore
public int getCountByType(int javaType)
public Set<Frame> getFrames()
getFrames
in interface NarrowFrameStore
public Frame getFrame(FrameID id)
getFrame
in interface NarrowFrameStore
public List getValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
NarrowFrameStore
getValues
in interface NarrowFrameStore
frame
- - the frameslot
- the slotfacet
- the facet. If this is non-null then we are looking at a facet value.isTemplate
- to be determined
public int getValuesCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
getValuesCount
in interface NarrowFrameStore
public void addValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
addValues
in interface NarrowFrameStore
public void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int from, int to)
NarrowFrameStore
moveValue
in interface NarrowFrameStore
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 valueto
- the position of the value after this callpublic void removeValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
removeValue
in interface NarrowFrameStore
public void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
setValues
in interface NarrowFrameStore
public Set<Frame> getFrames(Slot slot, Facet facet, boolean isTemplate, Object value)
getFrames
in interface NarrowFrameStore
public Set<Frame> getFramesWithAnyValue(Slot slot, Facet facet, boolean isTemplate)
getFramesWithAnyValue
in interface NarrowFrameStore
public Set<Frame> getMatchingFrames(Slot slot, Facet facet, boolean isTemplate, String regexp, int maxMatches)
getMatchingFrames
in interface NarrowFrameStore
slot
- the slotfacet
- the facetisTemplate
- whether we are looking at template valuesregexp
- the regexp to use for matchingmaxMatches
- the max number of matches (-1 for get all)
KnowledgeBase.getMatchingFrames
public Set<Reference> getReferences(Object value)
getReferences
in interface NarrowFrameStore
public Set<Reference> getMatchingReferences(String regexp, int maxMatches)
getMatchingReferences
in interface NarrowFrameStore
public void executeQuery(Query query, QueryCallback callback)
NarrowFrameStore
executeQuery
in interface NarrowFrameStore
public void deleteFrame(Frame frame)
deleteFrame
in interface NarrowFrameStore
public void close()
close
in interface NarrowFrameStore
public Set getClosure(Frame frame, Slot slot, Facet facet, boolean isTemplate)
getClosure
in interface NarrowFrameStore
public void replaceFrame(Frame frame)
NarrowFrameStore
replaceFrame
in interface NarrowFrameStore
public boolean beginTransaction(String name)
beginTransaction
in interface NarrowFrameStore
public boolean commitTransaction()
commitTransaction
in interface NarrowFrameStore
public boolean rollbackTransaction()
rollbackTransaction
in interface NarrowFrameStore
public TransactionMonitor getTransactionStatusMonitor()
NarrowFrameStore
getTransactionStatusMonitor
in interface NarrowFrameStore
|
Protege 3.3.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |