Protege 2.1.1

edu.stanford.smi.protege.model
Interface Frame

All Superinterfaces:
Comparable, Serializable
All Known Subinterfaces:
Cls, Facet, Instance, SimpleInstance, Slot
All Known Implementing Classes:
DefaultCls, DefaultFacet, DefaultFrame, DefaultInstance, DefaultSimpleInstance, DefaultSlot

public interface Frame
extends Comparable, Serializable

A container for slot and facet values. This definition of a Frame is roughly consistent with the OKBC notion. OKBC introduces a notion of a slot being attached to a frame as either an "own-slot" or as a "template-slot". A "template-slot" is a slot on a class which is automatically attached to subclasses and is automatically attached at all instances of the class. An "own-slot" is a slot on any frame (either a class or not) which is not automatically attached to subclasses and is not automatically attached to instances of the frame. Note that the difference between these two things is only relavent for class frames and we only support template slots on class frames. OKBC ascribes no meaning to template slots on non-classes. Own-slot values, even on a class, are not inherited to subclasses and do not occur on instances of the class. If a template slot has a value, this value is necessarily inherited to subclasses and appears on instances of the class. get/set slot and facet value methods return/take a collection of objects. The type of object returned or required depends on the value-type of the slot. The mapping between Protege value-types and Java object type is given below:

 Boolean    --> java.lang.Boolean
 Class      --> edu.stanford.smi.protege.model.Cls
 Float      --> java.lang.Float
 Instance   --> edu.stanford.smi.protege.model.Instance
 Integer    --> java.lang.Integer
 Symbol     --> java.lang.String
 String     --> java.lang.String
 

Author:
Ray Fergerson

Method Summary
 void addFrameListener(FrameListener listener)
           
 boolean addOwnFacetValue(Slot slot, Facet facet, Object value)
           
 void addOwnSlotValue(Slot slot, Object value)
           
 boolean areValidOwnSlotValues(Slot slot, Collection values)
           
 Frame copy(KnowledgeBase kb, Map valueMap, boolean isDeep)
           
 Frame deepCopy(KnowledgeBase kb, Map valueMap)
          Create a "deep copy" of the frame.
 void delete()
           
 String getBrowserText()
           
 URI getDefiningProjectURI()
           
 Object getDirectOwnSlotValue(Slot slot)
          see Frame for a description of the return type
 List getDirectOwnSlotValues(Slot slot)
          See Frame for a description of the return type.
 Collection getDocumentation()
           
 FrameID getFrameID()
           
 Icon getIcon()
           
 String getInvalidOwnSlotValuesText(Slot slot, Collection values)
           
 String getInvalidOwnSlotValueText(Slot slot, Object value)
           
 KnowledgeBase getKnowledgeBase()
           
 String getName()
           
 Object getOwnFacetValue(Slot slot, Facet facet)
          see Frame for a description of the return type
 Collection getOwnFacetValues(Slot slot, Facet facet)
          see Frame for a description of the return type
 boolean getOwnSlotAllowsMultipleValues(Slot slot)
           
 Collection getOwnSlotAndSubslotValues(Slot slot)
          Returns the own slot values for this slot and all of its subslots.
 Collection getOwnSlotDefaultValues(Slot slot)
          see Frame for a description of the return type
 Collection getOwnSlotFacets(Slot slot)
           
 Collection getOwnSlotFacetValues(Slot slot, Facet facet)
           
 Collection getOwnSlots()
          Gets the collection of own slots for a frame.
 Object getOwnSlotValue(Slot slot)
          see Frame for a description of the return type
 int getOwnSlotValueCount(Slot slot)
           
 Collection getOwnSlotValues(Slot slot)
          see Frame for a description of the return type
 ValueType getOwnSlotValueType(Slot slot)
           
 Project getProject()
           
 Collection getReferences()
           
 Collection getReferences(int maxReferences)
           
 boolean hasOwnSlot(Slot slot)
           
 boolean isDeleted()
           
 boolean isEditable()
           
 boolean isIncluded()
           
 boolean isSystem()
           
 boolean isValid()
          Deprecated. Use #isDeleted()
 boolean isValidOwnSlotValue(Slot slot, Object item)
           
 boolean isVisible()
           
 void markDeleted(boolean deleted)
           
 void moveOwnSlotValue(Slot slot, int fromIndex, int toIndex)
           
 void removeFrameListener(FrameListener listener)
           
 void removeOwnSlotValue(Slot slot, Object value)
          Remove _all_ occurrences of this value.
 void setDirectOwnSlotValue(Slot slot, Object value)
          Same as #setOwnSlotValue(Slot, Object)
 void setDirectOwnSlotValues(Slot slot, Collection values)
          Same as #setOwnSlotValues(Slot, Collection)
 void setDocumentation(Collection documentation)
           
 void setDocumentation(String documentation)
           
 void setEditable(boolean b)
           
 void setIncluded(boolean b)
           
 void setName(String newName)
           
 void setOwnFacetValue(Slot slot, Facet facet, Object value)
          See Frame for a description of the value type.
 void setOwnFacetValues(Slot slot, Facet facet, Collection values)
          See Frame for a description of the value type.
 void setOwnSlotValue(Slot slot, Object value)
          See Frame for a description of the value type.
 void setOwnSlotValues(Slot slot, Collection values)
          See Frame for a description of the value type.
 void setVisible(boolean b)
           
 Frame shallowCopy(KnowledgeBase kb, Map valueMap)
           
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

addFrameListener

public void addFrameListener(FrameListener listener)

addOwnFacetValue

public boolean addOwnFacetValue(Slot slot,
                                Facet facet,
                                Object value)

addOwnSlotValue

public void addOwnSlotValue(Slot slot,
                            Object value)

areValidOwnSlotValues

public boolean areValidOwnSlotValues(Slot slot,
                                     Collection values)

deepCopy

public Frame deepCopy(KnowledgeBase kb,
                      Map valueMap)
Create a "deep copy" of the frame. If a frame has slot values that refer to SimpleInstances then these instances are duplicated as well. References to classes, slots, and facets are not duplicated. The copy of the frame is placed in the "kb" KnowledgeBase. To duplicate an instance into its own knowledgeBase you can pass in null for the kb. Always pass in null for the valueMap argument.


shallowCopy

public Frame shallowCopy(KnowledgeBase kb,
                         Map valueMap)

copy

public Frame copy(KnowledgeBase kb,
                  Map valueMap,
                  boolean isDeep)

delete

public void delete()

getBrowserText

public String getBrowserText()

getIcon

public Icon getIcon()

getDocumentation

public Collection getDocumentation()

getFrameID

public FrameID getFrameID()

getInvalidOwnSlotValuesText

public String getInvalidOwnSlotValuesText(Slot slot,
                                          Collection values)

getInvalidOwnSlotValueText

public String getInvalidOwnSlotValueText(Slot slot,
                                         Object value)

getKnowledgeBase

public KnowledgeBase getKnowledgeBase()

getName

public String getName()

getOwnFacetValue

public Object getOwnFacetValue(Slot slot,
                               Facet facet)
see Frame for a description of the return type


getOwnFacetValues

public Collection getOwnFacetValues(Slot slot,
                                    Facet facet)
see Frame for a description of the return type


getOwnSlotAllowsMultipleValues

public boolean getOwnSlotAllowsMultipleValues(Slot slot)

getOwnSlotAndSubslotValues

public Collection getOwnSlotAndSubslotValues(Slot slot)
Returns the own slot values for this slot and all of its subslots. see Frame for a description of the return type


getOwnSlotDefaultValues

public Collection getOwnSlotDefaultValues(Slot slot)
see Frame for a description of the return type


getOwnSlotFacets

public Collection getOwnSlotFacets(Slot slot)

getOwnSlotFacetValues

public Collection getOwnSlotFacetValues(Slot slot,
                                        Facet facet)

getOwnSlots

public Collection getOwnSlots()
Gets the collection of own slots for a frame. These consist of the template slots of all of its direct types as well as the slots :NAME and :DIRECT-TYPE. See the Protege documentation (or the OKBC spec) for additional information about "own" and "template" slots.

Returns:
a collection of #Slot for this frame

getDirectOwnSlotValue

public Object getDirectOwnSlotValue(Slot slot)
see Frame for a description of the return type


getOwnSlotValue

public Object getOwnSlotValue(Slot slot)
see Frame for a description of the return type


getOwnSlotValueCount

public int getOwnSlotValueCount(Slot slot)

getOwnSlotValues

public Collection getOwnSlotValues(Slot slot)
see Frame for a description of the return type


getDirectOwnSlotValues

public List getDirectOwnSlotValues(Slot slot)
See Frame for a description of the return type.


getOwnSlotValueType

public ValueType getOwnSlotValueType(Slot slot)

getProject

public Project getProject()

getReferences

public Collection getReferences()

getReferences

public Collection getReferences(int maxReferences)

hasOwnSlot

public boolean hasOwnSlot(Slot slot)

isEditable

public boolean isEditable()

isIncluded

public boolean isIncluded()

getDefiningProjectURI

public URI getDefiningProjectURI()

isSystem

public boolean isSystem()

isValid

public boolean isValid()
Deprecated. Use #isDeleted()


markDeleted

public void markDeleted(boolean deleted)

isDeleted

public boolean isDeleted()

isValidOwnSlotValue

public boolean isValidOwnSlotValue(Slot slot,
                                   Object item)

isVisible

public boolean isVisible()

moveOwnSlotValue

public void moveOwnSlotValue(Slot slot,
                             int fromIndex,
                             int toIndex)

removeFrameListener

public void removeFrameListener(FrameListener listener)

removeOwnSlotValue

public void removeOwnSlotValue(Slot slot,
                               Object value)
Remove _all_ occurrences of this value.


setDocumentation

public void setDocumentation(String documentation)

setDocumentation

public void setDocumentation(Collection documentation)

setEditable

public void setEditable(boolean b)

setIncluded

public void setIncluded(boolean b)

setName

public void setName(String newName)

setOwnFacetValue

public void setOwnFacetValue(Slot slot,
                             Facet facet,
                             Object value)
See Frame for a description of the value type.


setOwnFacetValues

public void setOwnFacetValues(Slot slot,
                              Facet facet,
                              Collection values)
See Frame for a description of the value type.


setOwnSlotValue

public void setOwnSlotValue(Slot slot,
                            Object value)
See Frame for a description of the value type. This method sets the value of an own slot at a frame to a single value. The value passed in cannot be a Collection. To pass in a collection instead use setOwnSlotValues(Slot, Collection) (note the final "s"). This method can be called for either cardinality-single slots or cardinality-multiple slots.


setDirectOwnSlotValue

public void setDirectOwnSlotValue(Slot slot,
                                  Object value)
Same as #setOwnSlotValue(Slot, Object)


setOwnSlotValues

public void setOwnSlotValues(Slot slot,
                             Collection values)
See Frame for a description of the value type. This method sets the value of an own slot at a frame to a collection of values. This method can be called for either cardinality-single slots or cardinality-multiple slots. For a cardinality single slot the collection passed in must have no more than one element.


setDirectOwnSlotValues

public void setDirectOwnSlotValues(Slot slot,
                                   Collection values)
Same as #setOwnSlotValues(Slot, Collection)


setVisible

public void setVisible(boolean b)

Protege 2.1.1

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