All Packages Class Hierarchy This Package Previous Next Index
Class jtelos.cpp.cppProposition
java.lang.Object
|
+----jtelos.cpp.cppProposition
- public abstract class cppProposition
- extends Object
- implements Proposition
All Telos objects in the C++ KB, excepting the three primitive types
Integer, Real and String, are accessed through instances of the four
specializations of this class: cppAttribute, cppIndividual,
cppOmegaAttributeClass and cppOmegaIndividualClass.
Each Telos object in C++ can be represented by one or more Java
instances of the above four specializations of cppProposition. No instances of
cppProposition should ever be created; only instances of the above four
specializations can be made using this package. To that effect, the
constructor for this class is package visible only.
Note that only one cppProposition object can reference a single C++
telos object. Once a cppProposition object has been created to mirror a given
C++ telos object, the reference for this object is stored in the C++ library.
Hence, if any method in this package needs to return a cppProposition mirror
for the same C++ telos object, it will look up the already created Java
object and return the stored reference to it. This allows one to compare
cppProposition objects using references.
- See Also:
- cppIndividual, cppAttribute, PrimitiveType, cppKB, Proposition
-
addDirectAncestors(Proposition[])
- Makes all the propositions in the passed array ancestors of the
proposition.
-
addDirectParents(Proposition[])
- Makes all the propositions in the passed array parents of the
proposition.
-
allAncestors()
- All the propositions of which this proposition is a Telos instance.
-
allChildren()
- All the propositions which specialize this proposition in Telos.
-
allInstances()
- All the propositions of which this proposition is a Telos ancestor.
-
allParents()
- All the propositions that this proposition specializes in Telos.
-
attributes()
- All the attributes declared or inherited by this proposition in Telos.
-
attributes(String[], String)
-
All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter.
-
categories()
- If this proposition is an attribute, this method returns the labels
(without duplicates) of the attributes this attribute instantiates.
-
deleted()
-
Returns true iff the C++ mirror of this object has been deleted.
-
directAncestors()
- The propositions of which this proposition is an explicit Telos instance.
-
directAttributes()
- All the attributes directly declared by this proposition in Telos.
-
directAttributes(String[], String)
-
All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter.
-
directChildren()
- The propositions directly specializing this proposition in Telos.
-
directInstances()
- The propositions of which this proposition is an explicit Telos ancestor.
-
directParents()
- The propositions that this proposition directly specializes in Telos.
-
from()
- This returns the Telos source/declarer for this proposition.
-
inheritedAttributes()
- All the attributes directly declared by this proposition in Telos.
-
inheritedAttributes(String[], String)
-
All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter.
-
isAncestorOf(Proposition)
- Returns true if this proposition is a Telos ancestor of the parameter.
-
isBuiltin()
- This returns
true
iff the proposition is one of the Telos
builtin individuals.
-
isChildOf(Proposition)
- Returns true if this proposition is a Telos child (subclass) of
the parameter.
-
isInstanceOf(Proposition)
- Returns true if this proposition is a Telos instance of the parameter.
-
isParentOf(Proposition)
- Returns true if this proposition is a Telos parent (superclass) of the
parameter.
-
kb()
-
The KB in which this proposition resides.
-
label()
- This returns the Telos label for this proposition.
-
level()
- This returns the level of Telos instantiation for this proposition.
-
referencedBy()
- The attributes in this's KB that reference in Telos this proposition.
-
removeDirectAncestor(Proposition)
- Removes the passed ancestor from this proposition's "direct ancestors"
list and removes this proposition from that ancestor's "instances"
list.
-
removeDirectAttr(Attribute)
- This removes the passed attribute from the proposition.
-
removeDirectParent(Proposition)
- Removes the passed parent from this proposition's "direct parents" list and
removes this proposition from that parent's "direct children" list.
-
setDeclared(boolean)
- This method is not supported since it is incompatible with C++ telos.
-
setLevel(int)
- This method is not supported since it is incompatible with C++ telos.
-
telosName()
-
Implements the method described in
NamedObject
.
-
to()
- This returns the Telos target/destination for this proposition.
-
toString()
- Returns telosName();
deleted
public boolean deleted()
- Returns true iff the C++ mirror of this object has been deleted.
toString
public String toString()
- Returns telosName();
- Overrides:
- toString in class Object
telosName
public String telosName()
- Implements the method described in
NamedObject
.
This is overriden in cppAttribute.
- See Also:
- telosName, telosName
kb
public KB kb()
- The KB in which this proposition resides. There may be several KB's
available in Telos repositories, so Telos objects with the same name may
exist with different state in each KB (each of them is a
different Telos object sharing the same unique identifier
within the KB).
- See Also:
- kb
from
public Proposition from()
- This returns the Telos source/declarer for this proposition.
- See Also:
- from
label
public String label()
- This returns the Telos label for this proposition.
- See Also:
- telosName
to
public PropositionOrPrimitive to()
- This returns the Telos target/destination for this proposition.
- See Also:
- to
level
public final int level()
- This returns the level of Telos instantiation for this proposition.
- See Also:
- Levels
directInstances
public final Proposition[] directInstances()
- The propositions of which this proposition is an explicit Telos ancestor.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directAncestors, allAncestors, allInstances
directAncestors
public final Proposition[] directAncestors()
- The propositions of which this proposition is an explicit Telos instance.
- See Also:
- directInstances, allInstances, allAncestors
directChildren
public final Proposition[] directChildren()
- The propositions directly specializing this proposition in Telos.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directParents, allParents, allChildren
directParents
public final Proposition[] directParents()
- The propositions that this proposition directly specializes in Telos.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directChildren, allChildren, allParents
allInstances
public final Proposition[] allInstances()
- All the propositions of which this proposition is a Telos ancestor.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directAncestors, allAncestors, directInstances
allAncestors
public final Proposition[] allAncestors()
- All the propositions of which this proposition is a Telos instance.
- See Also:
- directInstances, allInstances, directAncestors
allChildren
public final Proposition[] allChildren()
- All the propositions which specialize this proposition in Telos.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directParents, allParents, directChildren
allParents
public final Proposition[] allParents()
- All the propositions that this proposition specializes in Telos.
- Throws: TokenAccessedAsAClassException
- when this is a Token.
- See Also:
- directChildren, allChildren, directParents
categories
public String[] categories()
- If this proposition is an attribute, this method returns the labels
(without duplicates) of the attributes this attribute instantiates.
This method is overriden for cppIndividuals to throw an
IndividualAccessedAsAnAttributeException
Note that an attribute may be in several categories sharing the same
label. So the number of categories will always be less than or equal to
the number of ancestors for this attribute. The
directAncestors()
and allAncestors()
methods in
this class return arrays of the actual ancestors of the attribute.
- See Also:
- directAncestors, allAncestors, categories
attributes
public Attribute[] attributes()
- All the attributes declared or inherited by this proposition in Telos.
- See Also:
- attributes
attributes
public Attribute[] attributes(String categories[],
String attrLabel)
- All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter. If
the label is null, then we return the attributes for this proposition
matching the categories. The returned attributes may be directly declared by
this proposition or they may be inherited.
- See Also:
- attributes
directAttributes
public Attribute[] directAttributes()
- All the attributes directly declared by this proposition in Telos.
- Throws: AttributeNotFoundException
- when no matches are found.
- See Also:
- directAttributes
directAttributes
public Attribute[] directAttributes(String categories[],
String attrLabel)
- All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter. If
the label is null, then we return the attributes for this proposition
matching the categories. The returned attributes are restricted to those
directly declared by this proposition.
- Throws: AttributeNotFoundException
- when no matches are found.
- See Also:
- directAttributes
inheritedAttributes
public Attribute[] inheritedAttributes()
- All the attributes directly declared by this proposition in Telos.
- Throws: AttributeNotFoundException
- when no matches are found.
- Throws: TokenAccessedAsAClassException
- when this is a Token since tokens
do not inherit attributes.
- See Also:
- inheritedAttributes
inheritedAttributes
public Attribute[] inheritedAttributes(String categories[],
String attrLabel)
- All the attributes for this proposition in precisely the categories named
in the first parameter and whose label also match the second parameter. If
the label is null, then we return the attributes for this proposition
matching the categories. The returned attributes are restricted to only
those inherited by this proposition.
- Throws: AttributeNotFoundException
- when no matches are found.
- Throws: TokenAccessedAsAClassException
- when this is a Token since tokens
do not inherit attributes.
- See Also:
- inheritedAttributes
referencedBy
public Attribute[] referencedBy()
- The attributes in this's KB that reference in Telos this proposition.
- See Also:
- referencedBy
isInstanceOf
public final boolean isInstanceOf(Proposition candidate)
- Returns true if this proposition is a Telos instance of the parameter.
isChildOf
public final boolean isChildOf(Proposition candidate)
- Returns true if this proposition is a Telos child (subclass) of
the parameter.
isAncestorOf
public final boolean isAncestorOf(Proposition candidate)
- Returns true if this proposition is a Telos ancestor of the parameter.
isParentOf
public final boolean isParentOf(Proposition candidate)
- Returns true if this proposition is a Telos parent (superclass) of the
parameter.
isBuiltin
public final boolean isBuiltin()
- This returns
true
iff the proposition is one of the Telos
builtin individuals.
setDeclared
public final void setDeclared(boolean isDeclared)
- This method is not supported since it is incompatible with C++ telos.
setLevel
public final void setLevel(int level)
- This method is not supported since it is incompatible with C++ telos.
addDirectAncestors
public void addDirectAncestors(Proposition newDirectAncestors[])
- Makes all the propositions in the passed array ancestors of the
proposition.
- Throws: TellException
- is thrown if any semantic errors are
encountered.
- Throws: ImmutableBuiltInException
- is thrown if this is a builtin.
- See Also:
- TELL, RETELL
addDirectParents
public void addDirectParents(Proposition newDirectParents[])
- Makes all the propositions in the passed array parents of the
proposition.
- Throws: TellException
- is thrown if any semantic errors are
encountered.
- Throws: ImmutableBuiltInException
- is thrown if this is a builtin.
- See Also:
- TELL, RETELL
removeDirectAncestor
public void removeDirectAncestor(Proposition ancestor)
- Removes the passed ancestor from this proposition's "direct ancestors"
list and removes this proposition from that ancestor's "instances"
list. Note that it does not remove the ancestor from the KB.
Preconditions: Neither this proposition nor the removed
ancestor can be builtins. Also, this proposition cannot have
instances.
- Throws: UntellException
- is thrown if any semantic errors are encountered.
- Throws: ImmutableBuiltInException
- is thrown if this or the ancestor to
be removed are built-in classes.
removeDirectParent
public void removeDirectParent(Proposition parent)
- Removes the passed parent from this proposition's "direct parents" list and
removes this proposition from that parent's "direct children" list. Note
that it does not remove the parent from the KB. Note also, that since IsA
is a transitive relation and Telos supports multiple inheritance, the
removed parent may still be an indirect parent of this
proposition. For instance, this happens when an unremoved parent's parent
is the removed direct parent.
Preconditions: Neither this proposition nor the parent to be
removed can be built-in propositions. Moreover, this proposition cannot
have instances.
- Throws: UntellException
- is thrown if any semantic errors are encountered.
- Throws: ImmutableBuiltInException
- is thrown if this or the ancestor to
be removed are built-in classes.
removeDirectAttr
public void removeDirectAttr(Attribute attr)
- This removes the passed attribute from the proposition. Note that since
each attribute is declared by only one proposition, this also deletes
the attribute from the KB.
Preconditions: The attribute cannot be a builtin. There cannot
be any instances of the attribute's declarer
(from/source proposition) in the KB.
- Throws: UntellException
- is thrown if any semantic errors are encountered.
- Throws: ImmutableBuiltInException
- is thrown if the attribute to
be removed is a built-in class.
All Packages Class Hierarchy This Package Previous Next Index