edu.stanford.smi.protege.storage.jdbc
Class FrameManager
java.lang.Object
edu.stanford.smi.protege.storage.jdbc.FrameManager
- All Implemented Interfaces:
- Disposable
- public class FrameManager
- extends Object
- implements Disposable
This class handles most of the management for a collection of frames. It is a delegate of
the knowledge base class. DefaultKnowledgeBase handles event notifications, journaling, and convenience methods.
This class handles most other stuff. This class in turn simplifies and collapses the calls (reducting them only
to slot/facet gets/sets and then delegates them to an implementation of Storage
- Author:
- Ray Fergerson
Method Summary |
void |
addDirectSuperclass(Cls child,
Cls parent)
|
void |
addDirectTemplateSlot(Cls cls,
Slot slot)
|
void |
addInstance(Instance instance,
String name,
Cls type)
|
void |
addOwnSlotValue(Frame frame,
Slot slot,
Object value)
|
void |
addOwnSlotValue(Frame frame,
Slot slot,
Object value,
int index)
|
void |
addTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value)
|
void |
addTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value,
int index)
|
void |
addTemplateSlotValue(Cls cls,
Slot slot,
Object value)
|
boolean |
beginTransaction()
|
boolean |
containsFrame(String name)
|
void |
deleteCls(Cls cls)
|
void |
deleteFacet(Facet facet)
|
void |
deleteSimpleInstance(Instance instance)
|
void |
deleteSlot(Slot slot)
|
void |
dispose()
|
boolean |
endTransaction(boolean doCommit)
|
static boolean |
equals(Object o1,
Object o2)
|
int |
getClsCount()
|
Collection |
getDefaultValues(Frame frame)
|
Facet |
getDefaultValuesFacet()
|
Slot |
getDefaultValuesSlot()
|
int |
getDirectInstanceCount(Cls type)
|
Collection |
getDirectInstances(Cls type)
|
Slot |
getDirectInstancesSlot()
|
int |
getDirectSubclassCount(Cls parent)
|
Collection |
getDirectSubclasses(Cls parent)
|
Slot |
getDirectSubclassesSlot()
|
int |
getDirectSuperclassCount(Cls cls)
|
Collection |
getDirectSuperclasses(Cls cls)
|
Slot |
getDirectSuperclassesSlot()
|
Slot |
getDirectSuperslotsSlot()
|
List |
getDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
|
Collection |
getDirectTemplateSlots(Cls cls)
|
Slot |
getDirectTemplateSlotsSlot()
|
List |
getDirectTemplateSlotValues(Cls cls,
Slot slot)
|
Cls |
getDirectType(Instance instance)
|
Slot |
getDirectTypeSlot()
|
int |
getFacetCount()
|
Frame |
getFrame(FrameID id)
|
Frame |
getFrame(String name)
|
int |
getFrameCount()
|
Collection |
getFrames()
|
Collection |
getFramesWithValue(Slot slot,
Facet facet,
boolean isTemplate,
Object o)
|
int |
getInstanceCount(Cls type)
|
Collection |
getInstances(Cls type)
|
Collection |
getMatchingFrames(Slot slot,
Facet facet,
boolean isTemplate,
String s,
int maxMatches)
|
String |
getName(Frame frame)
|
Slot |
getNameSlot()
|
Collection |
getOwnSlotAndSubslotValues(Frame frame,
Slot slot)
|
Collection |
getOwnSlotFacetValues(Frame frame,
Slot slot,
Facet facet)
|
Collection |
getOwnSlots(Frame frame)
|
Object |
getOwnSlotValue(Frame frame,
Slot slot)
|
int |
getOwnSlotValueCount(Frame frame,
Slot slot)
|
Collection |
getOwnSlotValues(Frame frame,
Slot slot)
|
Collection |
getReferences(Object o,
int maxReferences)
|
int |
getSimpleInstanceCount()
|
int |
getSlotCount()
|
Storage |
getStorage()
|
int |
getSubclassCount(Cls parent)
|
Collection |
getSubclasses(Cls parent)
|
int |
getSuperclassCount(Cls child)
|
Set |
getSuperclasses(Cls child)
|
Collection |
getTemplateFacets(Cls cls,
Slot slot)
|
Object |
getTemplateFacetValue(Cls cls,
Slot slot,
Facet facet)
|
Collection |
getTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
|
Collection |
getTemplateSlotDefaultValues(Cls cls,
Slot slot)
|
Collection |
getTemplateSlots(Cls cls)
|
Object |
getTemplateSlotValue(Cls cls,
Slot slot)
|
Collection |
getTemplateSlotValues(Cls cls,
Slot slot)
|
Collection |
getValues(Slot slot)
|
Facet |
getValuesFacet()
|
Slot |
getValuesSlot()
|
boolean |
hasDirectlyOverriddenTemplateFacet(Cls cls,
Slot slot,
Facet facet)
|
boolean |
hasDirectlyOverriddenTemplateSlot(Cls cls,
Slot slot)
|
boolean |
hasDirectSubclass(Cls parent,
Cls child)
|
boolean |
hasDirectSuperclass(Cls child,
Cls parent)
|
boolean |
hasDirectSuperslot(Slot slot,
Slot superSlot)
|
boolean |
hasDirectTemplateSlot(Cls cls,
Slot slot)
|
boolean |
hasDirectType(Instance instance,
Cls type)
|
boolean |
hasInheritedTemplateSlot(Cls cls,
Slot slot)
|
boolean |
hasOverriddenTemplateFacet(Cls cls,
Slot slot,
Facet facet)
|
boolean |
hasOverriddenTemplateSlot(Cls cls,
Slot slot)
|
boolean |
hasOwnFacet(Frame frame,
Slot slot,
Facet facet)
|
boolean |
hasOwnSlot(Frame frame,
Slot slot)
|
boolean |
hasSubclass(Cls parent,
Cls child)
|
boolean |
hasSuperclass(Cls child,
Cls superclass)
|
boolean |
hasTemplateFacet(Cls cls,
Slot slot,
Facet facet)
|
boolean |
hasTemplateSlot(Cls cls,
Slot slot)
|
boolean |
hasType(Instance instance,
Cls type)
|
boolean |
hasValueAtSomeFrame(Slot slot,
Facet facet,
boolean isTemplate)
|
void |
moveDirectSubclass(Cls parent,
Cls child,
Cls afterClass)
move child class to appear after "afterClass" in the subclasses of parent. |
void |
moveDirectSuperclass(Cls child,
Cls parent,
Cls afterCls)
|
void |
moveOwnSlotValue(Frame frame,
Slot slot,
int fromIndex,
int toIndex)
|
void |
moveTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
int fromIndex,
int toIndex)
|
void |
removeDirectSuperclass(Cls child,
Cls parent)
|
void |
removeDirectTemplateSlot(Cls cls,
Slot slot)
|
void |
removeOwnSlotValue(Frame frame,
Slot slot,
Object value)
|
void |
removeTemplateFacetValueOverrides(Cls cls,
Slot slot)
|
void |
removeValues(Slot slot,
Facet facet,
boolean isTemplate,
Cls cls)
|
void |
setDefaultValues(Frame frame,
Collection values)
|
void |
setDirectType(Instance instance,
Cls newType)
|
void |
setName(Frame frame,
String newName)
|
void |
setOwnSlotValue(Frame frame,
Slot slot,
Object value)
|
void |
setOwnSlotValues(Frame frame,
Slot slot,
Collection values)
|
void |
setStorage(Storage storage)
|
void |
setTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value)
|
void |
setTemplateFacetValues(Cls cls,
Slot slot,
Facet facet,
Collection newValues)
|
void |
setTemplateSlotDefaultValues(Cls cls,
Slot slot,
Collection values)
|
void |
setTemplateSlotValue(Cls cls,
Slot slot,
Object value)
|
void |
setTemplateSlotValues(Cls cls,
Slot slot,
Collection values)
|
void |
setValues(Slot slot,
Collection values)
|
boolean |
supportsTransactions()
|
void |
swapInstance(Instance from,
Instance to)
replace all references to/from "from" with references to/from "to" |
String |
toString()
|
FrameManager
public FrameManager(OldJdbcDefaultKnowledgeBase kb)
addDirectSuperclass
public void addDirectSuperclass(Cls child,
Cls parent)
addDirectTemplateSlot
public void addDirectTemplateSlot(Cls cls,
Slot slot)
addInstance
public void addInstance(Instance instance,
String name,
Cls type)
addOwnSlotValue
public void addOwnSlotValue(Frame frame,
Slot slot,
Object value)
addOwnSlotValue
public void addOwnSlotValue(Frame frame,
Slot slot,
Object value,
int index)
addTemplateFacetValue
public void addTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value)
addTemplateFacetValue
public void addTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value,
int index)
addTemplateSlotValue
public void addTemplateSlotValue(Cls cls,
Slot slot,
Object value)
beginTransaction
public boolean beginTransaction()
containsFrame
public boolean containsFrame(String name)
deleteCls
public void deleteCls(Cls cls)
deleteFacet
public void deleteFacet(Facet facet)
deleteSimpleInstance
public void deleteSimpleInstance(Instance instance)
deleteSlot
public void deleteSlot(Slot slot)
dispose
public void dispose()
- Specified by:
dispose
in interface Disposable
endTransaction
public boolean endTransaction(boolean doCommit)
getDefaultValues
public Collection getDefaultValues(Frame frame)
getDefaultValuesFacet
public Facet getDefaultValuesFacet()
getDefaultValuesSlot
public Slot getDefaultValuesSlot()
getDirectInstanceCount
public int getDirectInstanceCount(Cls type)
getDirectInstances
public Collection getDirectInstances(Cls type)
getDirectInstancesSlot
public Slot getDirectInstancesSlot()
getDirectSubclassCount
public int getDirectSubclassCount(Cls parent)
getDirectSubclasses
public Collection getDirectSubclasses(Cls parent)
getDirectSubclassesSlot
public Slot getDirectSubclassesSlot()
getDirectSuperclassCount
public int getDirectSuperclassCount(Cls cls)
getDirectSuperclasses
public Collection getDirectSuperclasses(Cls cls)
getDirectSuperclassesSlot
public Slot getDirectSuperclassesSlot()
getDirectSuperslotsSlot
public Slot getDirectSuperslotsSlot()
getDirectTemplateFacetValues
public List getDirectTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
getDirectTemplateSlots
public Collection getDirectTemplateSlots(Cls cls)
getDirectTemplateSlotsSlot
public Slot getDirectTemplateSlotsSlot()
getDirectTemplateSlotValues
public List getDirectTemplateSlotValues(Cls cls,
Slot slot)
getDirectType
public Cls getDirectType(Instance instance)
getDirectTypeSlot
public Slot getDirectTypeSlot()
getFrame
public Frame getFrame(FrameID id)
getFrame
public Frame getFrame(String name)
getFrameCount
public int getFrameCount()
getFacetCount
public int getFacetCount()
getSlotCount
public int getSlotCount()
getClsCount
public int getClsCount()
getFrames
public Collection getFrames()
getInstanceCount
public int getInstanceCount(Cls type)
getInstances
public Collection getInstances(Cls type)
getMatchingFrames
public Collection getMatchingFrames(Slot slot,
Facet facet,
boolean isTemplate,
String s,
int maxMatches)
getFramesWithValue
public Collection getFramesWithValue(Slot slot,
Facet facet,
boolean isTemplate,
Object o)
getName
public String getName(Frame frame)
getNameSlot
public Slot getNameSlot()
getOwnSlotAndSubslotValues
public Collection getOwnSlotAndSubslotValues(Frame frame,
Slot slot)
getOwnSlotFacetValues
public Collection getOwnSlotFacetValues(Frame frame,
Slot slot,
Facet facet)
getOwnSlots
public Collection getOwnSlots(Frame frame)
getOwnSlotValue
public Object getOwnSlotValue(Frame frame,
Slot slot)
getOwnSlotValueCount
public int getOwnSlotValueCount(Frame frame,
Slot slot)
getOwnSlotValues
public Collection getOwnSlotValues(Frame frame,
Slot slot)
getReferences
public Collection getReferences(Object o,
int maxReferences)
getStorage
public Storage getStorage()
getSubclassCount
public int getSubclassCount(Cls parent)
getSubclasses
public Collection getSubclasses(Cls parent)
getSuperclassCount
public int getSuperclassCount(Cls child)
getSuperclasses
public Set getSuperclasses(Cls child)
getTemplateFacets
public Collection getTemplateFacets(Cls cls,
Slot slot)
getTemplateFacetValue
public Object getTemplateFacetValue(Cls cls,
Slot slot,
Facet facet)
getTemplateFacetValues
public Collection getTemplateFacetValues(Cls cls,
Slot slot,
Facet facet)
getTemplateSlotDefaultValues
public Collection getTemplateSlotDefaultValues(Cls cls,
Slot slot)
getTemplateSlots
public Collection getTemplateSlots(Cls cls)
getTemplateSlotValue
public Object getTemplateSlotValue(Cls cls,
Slot slot)
getTemplateSlotValues
public Collection getTemplateSlotValues(Cls cls,
Slot slot)
getValues
public Collection getValues(Slot slot)
getValuesFacet
public Facet getValuesFacet()
getValuesSlot
public Slot getValuesSlot()
hasDirectlyOverriddenTemplateFacet
public boolean hasDirectlyOverriddenTemplateFacet(Cls cls,
Slot slot,
Facet facet)
hasDirectlyOverriddenTemplateSlot
public boolean hasDirectlyOverriddenTemplateSlot(Cls cls,
Slot slot)
hasDirectSubclass
public boolean hasDirectSubclass(Cls parent,
Cls child)
hasDirectSuperclass
public boolean hasDirectSuperclass(Cls child,
Cls parent)
hasDirectSuperslot
public boolean hasDirectSuperslot(Slot slot,
Slot superSlot)
hasDirectTemplateSlot
public boolean hasDirectTemplateSlot(Cls cls,
Slot slot)
hasDirectType
public boolean hasDirectType(Instance instance,
Cls type)
hasInheritedTemplateSlot
public boolean hasInheritedTemplateSlot(Cls cls,
Slot slot)
hasOverriddenTemplateFacet
public boolean hasOverriddenTemplateFacet(Cls cls,
Slot slot,
Facet facet)
hasOverriddenTemplateSlot
public boolean hasOverriddenTemplateSlot(Cls cls,
Slot slot)
hasOwnFacet
public boolean hasOwnFacet(Frame frame,
Slot slot,
Facet facet)
hasOwnSlot
public boolean hasOwnSlot(Frame frame,
Slot slot)
hasSubclass
public boolean hasSubclass(Cls parent,
Cls child)
hasSuperclass
public boolean hasSuperclass(Cls child,
Cls superclass)
hasTemplateFacet
public boolean hasTemplateFacet(Cls cls,
Slot slot,
Facet facet)
hasTemplateSlot
public boolean hasTemplateSlot(Cls cls,
Slot slot)
hasType
public boolean hasType(Instance instance,
Cls type)
hasValueAtSomeFrame
public boolean hasValueAtSomeFrame(Slot slot,
Facet facet,
boolean isTemplate)
moveDirectSubclass
public void moveDirectSubclass(Cls parent,
Cls child,
Cls afterClass)
- move child class to appear after "afterClass" in the subclasses of parent.
if afterClass is null then the child will appear as the first child first.
moveDirectSuperclass
public void moveDirectSuperclass(Cls child,
Cls parent,
Cls afterCls)
moveOwnSlotValue
public void moveOwnSlotValue(Frame frame,
Slot slot,
int fromIndex,
int toIndex)
moveTemplateFacetValue
public void moveTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
int fromIndex,
int toIndex)
removeDirectSuperclass
public void removeDirectSuperclass(Cls child,
Cls parent)
removeDirectTemplateSlot
public void removeDirectTemplateSlot(Cls cls,
Slot slot)
removeOwnSlotValue
public void removeOwnSlotValue(Frame frame,
Slot slot,
Object value)
removeTemplateFacetValueOverrides
public void removeTemplateFacetValueOverrides(Cls cls,
Slot slot)
removeValues
public void removeValues(Slot slot,
Facet facet,
boolean isTemplate,
Cls cls)
setDefaultValues
public void setDefaultValues(Frame frame,
Collection values)
setDirectType
public void setDirectType(Instance instance,
Cls newType)
equals
public static boolean equals(Object o1,
Object o2)
setName
public void setName(Frame frame,
String newName)
setOwnSlotValue
public void setOwnSlotValue(Frame frame,
Slot slot,
Object value)
setOwnSlotValues
public void setOwnSlotValues(Frame frame,
Slot slot,
Collection values)
setStorage
public void setStorage(Storage storage)
setTemplateFacetValue
public void setTemplateFacetValue(Cls cls,
Slot slot,
Facet facet,
Object value)
setTemplateFacetValues
public void setTemplateFacetValues(Cls cls,
Slot slot,
Facet facet,
Collection newValues)
setTemplateSlotDefaultValues
public void setTemplateSlotDefaultValues(Cls cls,
Slot slot,
Collection values)
setTemplateSlotValue
public void setTemplateSlotValue(Cls cls,
Slot slot,
Object value)
setTemplateSlotValues
public void setTemplateSlotValues(Cls cls,
Slot slot,
Collection values)
setValues
public void setValues(Slot slot,
Collection values)
supportsTransactions
public boolean supportsTransactions()
swapInstance
public void swapInstance(Instance from,
Instance to)
- replace all references to/from "from" with references to/from "to"
- Parameters:
from
- Description of Parameterto
- Description of Parameter
toString
public String toString()
getSimpleInstanceCount
public int getSimpleInstanceCount()
Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2005 Stanford University.