Algernon Software

org.algernon.kb
Interface AlgernonRelation

All Superinterfaces:
AlgernonFrame, Displayable
All Known Implementing Classes:
AlgernonProtegeRelation

public interface AlgernonRelation
extends AlgernonFrame

This defines an interface for a relation in Algernon.


Method Summary
 List getArgumentTypes()
          Returns a list of the argument types for this relation.
 int getMaximumCardinality()
          Returns the maximum cardinality of this relation.
 int getMinimumCardinality()
          Returns the minimum cardinality of this relation.
 boolean rangeIsSimpleType()
          Returns true if the range is a non-frame type.
 void setDefaultValue(Object defaultValue)
          Sets the default value of a template slot.
 void setInverseRelation(AlgernonRelation inverseRelation)
          Sets the inverse relation of this relation.
 void setMaxCardinality(Integer maxCardinality)
          Sets the maximum cardinality of the Relation.
 void setMinCardinality(Integer minCardinality)
          Sets the minimum cardinality of the Relation.
 void setRange(AlgernonClass range)
          Sets the range of the relation.
 void setRange(LispValue range)
          Sets the range of a relation when it is a value type such as :INTEGER, instead of a class.
 
Methods inherited from interface org.algernon.kb.AlgernonFrame
addRelationValue, deleteAllRelationValues, deleteRelationValue, deleteRelationValues, getDisplayName, getImplementation, getKB, getName, getOwnRelationValues, getParents, getPossibleRelationValues, getRelationValues, getRootClasses, getSuperclasses, hasParent, hasRootClass, hasSuperclass, setDisplayName, setName
 
Methods inherited from interface org.algernon.io.Displayable
display
 

Method Detail

getArgumentTypes

public List getArgumentTypes()
                      throws AlgernonDataException
Returns a list of the argument types for this relation. The length of the list is the number of parameters in the relation. The first item in the list a Set of the classes of frames in the domain of this relation. The next item(s) in the list are the types of the values of the relation.

Throws:
AlgernonDataException

getMinimumCardinality

public int getMinimumCardinality()
Returns the minimum cardinality of this relation.


getMaximumCardinality

public int getMaximumCardinality()
Returns the maximum cardinality of this relation.


rangeIsSimpleType

public boolean rangeIsSimpleType()
Returns true if the range is a non-frame type.


setInverseRelation

public void setInverseRelation(AlgernonRelation inverseRelation)
Sets the inverse relation of this relation. If null, does nothing. Otherwise, it should already exist.

Parameters:
inverseRelation -

setDefaultValue

public void setDefaultValue(Object defaultValue)
                     throws AlgernonDataException
Sets the default value of a template slot.

Parameters:
defaultValue -
Throws:
AlgernonDataException

setMaxCardinality

public void setMaxCardinality(Integer maxCardinality)
Sets the maximum cardinality of the Relation.

Parameters:
maxCardinality -

setMinCardinality

public void setMinCardinality(Integer minCardinality)
Sets the minimum cardinality of the Relation.

Parameters:
minCardinality -

setRange

public void setRange(LispValue range)
Sets the range of a relation when it is a value type such as :INTEGER, instead of a class.

Parameters:
range - the value type of the relation.

setRange

public void setRange(AlgernonClass range)
Sets the range of the relation.

Parameters:
range - a Class which is the range of the relation.

Algernon Software