Algernon Software

org.algernon.kb
Interface AlgernonFrame

All Superinterfaces:
Displayable
All Known Subinterfaces:
AlgernonClass, AlgernonFacet, AlgernonInstance, AlgernonRelation
All Known Implementing Classes:
AlgernonProtegeClass, AlgernonProtegeFacet, AlgernonProtegeFrame, AlgernonProtegeInstance, AlgernonProtegeRelation

public interface AlgernonFrame
extends Displayable

This defines an interface for an Algernon Frame.


Method Summary
 void addRelationValue(AlgernonRelation relation, Object value)
          Adds the given value to the relation on this Frame.
 void deleteAllRelationValues(AlgernonRelation relation)
          Deletes all values on the given slot for this frame.
 void deleteRelationValue(AlgernonRelation relation, Object value)
          Deletes one value of a relation on this frame.
 void deleteRelationValues(AlgernonRelation relation, Collection values)
          Calls deleteRelationValue for each value in the Collection.
 String getDisplayName()
          Returns the display name of this Frame, or the name if the display name relation is not defined.
 Object getImplementation()
          Returns the KBMS-specific object implementing this interface.
 AlgernonKB getKB()
          Returns the KB this Frame belongs to.
 String getName()
          Returns the name of this Frame.
 Collection getOwnRelationValues(AlgernonRelation slot)
          Returns a collection of the values in the given slot.
 List getParents()
          Returns a List of the parents of this frame.
 Collection getPossibleRelationValues(AlgernonRelation relation)
          Returns the list of existing instances that could fill the given relation on this frame.
 Collection getRelationValues(AlgernonRelation relation)
          Returns the relation values.
 Collection getRootClasses()
          Returns a collection of root classes of this class.
 Collection getSuperclasses()
          Returns the superclass(es) of a class or the class(es) of an instance.
 boolean hasParent(AlgernonFrame parent)
          Returns true if the argument is a parent of this frame.
 boolean hasRootClass(AlgernonClass root)
          Returns true if root is a root class of this class.
 boolean hasSuperclass(AlgernonClass theClass)
          Returns true if this class includes superclass as one of its superclasses, direct or indirect.
 void setDisplayName(String newName)
          Sets this frame's display name (that is, a pretty name) to the given string.
 void setName(String newName)
          Sets the name (:NAME) of this frame.
 
Methods inherited from interface org.algernon.io.Displayable
display
 

Method Detail

getImplementation

public Object getImplementation()
Returns the KBMS-specific object implementing this interface.


getName

public String getName()
Returns the name of this Frame.


getDisplayName

public String getDisplayName()
                      throws AlgernonDataException,
                             AlgernonException
Returns the display name of this Frame, or the name if the display name relation is not defined.

Throws:
AlgernonDataException
AlgernonException

getKB

public AlgernonKB getKB()
Returns the KB this Frame belongs to.


addRelationValue

public void addRelationValue(AlgernonRelation relation,
                             Object value)
Adds the given value to the relation on this Frame.


getParents

public List getParents()
Returns a List of the parents of this frame. For classes, this means its superclass(es) all the way up to the root class(es) of the KB. For instances, this means the class(es) of the KB and all of their superclasses up to the root class(es). For slots, this is all parents that are slots.


getPossibleRelationValues

public Collection getPossibleRelationValues(AlgernonRelation relation)
                                     throws AlgernonDataException
Returns the list of existing instances that could fill the given relation on this frame.

Throws:
AlgernonDataException

getRelationValues

public Collection getRelationValues(AlgernonRelation relation)
                             throws AlgernonDataException,
                                    AlgernonException
Returns the relation values.

Throws:
AlgernonDataException
AlgernonException

getSuperclasses

public Collection getSuperclasses()
Returns the superclass(es) of a class or the class(es) of an instance.


deleteRelationValue

public void deleteRelationValue(AlgernonRelation relation,
                                Object value)
Deletes one value of a relation on this frame. If the value doesn't exist on the slot, nothing is changed.


deleteRelationValues

public void deleteRelationValues(AlgernonRelation relation,
                                 Collection values)
Calls deleteRelationValue for each value in the Collection.

See Also:
deleteRelationValue(org.algernon.kb.AlgernonRelation, java.lang.Object)

deleteAllRelationValues

public void deleteAllRelationValues(AlgernonRelation relation)
Deletes all values on the given slot for this frame.

See Also:
deleteRelationValue(org.algernon.kb.AlgernonRelation, java.lang.Object)

hasRootClass

public boolean hasRootClass(AlgernonClass root)
Returns true if root is a root class of this class.


getRootClasses

public Collection getRootClasses()
Returns a collection of root classes of this class.

Returns:
a collection of AlgernonClass objects.

hasSuperclass

public boolean hasSuperclass(AlgernonClass theClass)
Returns true if this class includes superclass as one of its superclasses, direct or indirect.

Parameters:
theClass - the superclass to check
Returns:
true if the superclass is a superclass of this class, false otherwise.

hasParent

public boolean hasParent(AlgernonFrame parent)
Returns true if the argument is a parent of this frame. A parent is a member of the return value of (@link getParents).


setDisplayName

public void setDisplayName(String newName)
                    throws AlgernonDataException,
                           AlgernonException
Sets this frame's display name (that is, a pretty name) to the given string.

Parameters:
newName -
Throws:
AlgernonDataException
AlgernonException

setName

public void setName(String newName)
Sets the name (:NAME) of this frame.


getOwnRelationValues

public Collection getOwnRelationValues(AlgernonRelation slot)
                                throws AlgernonException
Returns a collection of the values in the given slot.

Throws:
AlgernonException

Algernon Software