|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This defines an interface for an Algernon Class
Method Summary | |
void |
addRelation(AlgernonRelation relation)
Adds a new relation to this class. |
AlgernonInstance |
createInstance(String name)
Creates an instance with the given name. |
AlgernonInstance |
createInstance(String name,
String displayName)
Creates an instance with the given name and stores the "pretty" name in the display name slot. |
Collection |
getDirectInstances()
|
Collection |
getDirectSubclasses()
|
Collection |
getDirectSuperclasses()
|
Collection |
getInstances()
|
Collection |
getLeafSubclasses()
Returns a collection of subclasses of this class that are leaves. |
List |
getRelationArgumentTypes(AlgernonRelation relation)
Gets the argument types of a relation as defined for that class. |
Collection |
getSubclasses()
|
Collection |
getTemplateRelations()
Returns the relations that are templates on this class. |
boolean |
hasDirectInstance(AlgernonInstance instance)
Returns true if this class includes instance
as one of its direct instances. |
boolean |
hasDirectSuperclass(AlgernonClass theClass)
Returns true if this class includes superclass
as one of its direct superclasses. |
boolean |
hasInstance(AlgernonInstance instance)
Returns true if this class includes instance
as one of its direct instances, or as a direct instance of
one of its subclasses. |
boolean |
hasLeafSubclass(AlgernonClass leaf)
Returns true if leaf is a leaf subclass of this class. |
boolean |
hasTemplateRelation(AlgernonRelation relation)
Returns true if the given relation is a template relation of this class. |
boolean |
isLeafClass()
Returns true if this is one of the leaf classes of the KB. |
boolean |
isRootClass()
Returns true if this is one of the root classes of the KB. |
AlgernonRelation |
lookupRelation(String name)
Some KBMS support redefining relations (slots) at different classes. |
void |
setRelationDefaultValue(AlgernonRelation relation,
Object defaultValue)
Sets the default value of a relation as defined on this class. |
void |
setRelationInverseRelation(AlgernonRelation relation,
AlgernonRelation inverseRelation)
Sets the inverse relation of a relation as defined on this class. |
void |
setRelationMaxCardinality(AlgernonRelation relation,
Integer maxCardinality)
Sets the maximum cardinality of a relation as defined on this class. |
void |
setRelationMinCardinality(AlgernonRelation relation,
Integer minCardinality)
Sets the minimum cardinality of a relation as defined on this class. |
void |
setRelationRange(AlgernonRelation relation,
AlgernonClass theClass)
Sets the range of a relation as defined on this class. |
void |
setRelationRange(AlgernonRelation relation,
LispValue valueType)
Sets the range of a relation as defined on this 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 |
public AlgernonInstance createInstance(String name)
public AlgernonInstance createInstance(String name, String displayName) throws AlgernonDataException
AlgernonDataException
public void addRelation(AlgernonRelation relation)
public Collection getInstances()
public Collection getDirectInstances()
public Collection getDirectSuperclasses()
public Collection getDirectSubclasses()
public Collection getSubclasses()
public Collection getTemplateRelations()
public boolean hasDirectInstance(AlgernonInstance instance)
instance
as one of its direct instances.
instance
- the instance to check
public boolean hasInstance(AlgernonInstance instance)
instance
as one of its direct instances, or as a direct instance of
one of its subclasses. Since it is cheaper to look
upward rather than downard, this actuallcalls
AlgernonInstance.hasSuperclass to get the answer.
instance
- the instance to check
public boolean hasDirectSuperclass(AlgernonClass theClass)
superclass
as one of its direct superclasses.
theClass
- the superclass to check
public boolean hasLeafSubclass(AlgernonClass leaf)
leaf
is a leaf subclass of this class.
public Collection getLeafSubclasses()
public boolean isRootClass()
public boolean isLeafClass()
public AlgernonRelation lookupRelation(String name)
name
- the name of the relation to be found.
public List getRelationArgumentTypes(AlgernonRelation relation) throws AlgernonDataException
relation
-
AlgernonDataException
public void setRelationRange(AlgernonRelation relation, AlgernonClass theClass)
relation
- theClass
- public void setRelationRange(AlgernonRelation relation, LispValue valueType)
relation
- valueType
- public void setRelationMinCardinality(AlgernonRelation relation, Integer minCardinality)
relation
- minCardinality
- public void setRelationMaxCardinality(AlgernonRelation relation, Integer maxCardinality)
relation
- maxCardinality
- public void setRelationDefaultValue(AlgernonRelation relation, Object defaultValue)
relation
- defaultValue
- public void setRelationInverseRelation(AlgernonRelation relation, AlgernonRelation inverseRelation)
relation
- inverseRelation
- public boolean hasTemplateRelation(AlgernonRelation relation)
relation
-
|
Algernon Software | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |