gov.nasa.arc.brahms.vm.rt
Interface IStatementSet

All Known Implementing Classes:
StatementSet

public interface IStatementSet

The IStatementSet is an interface for statement sets. A Statement set manages a set of statements allowing for assertion and retraction of statements. On assertion of a statement the statement checks makes sure that single valued statements remain single valued by retracting the old value before replacing it with the new value. The statement set also allows for quick access to statements based on a specified concept and attribute and optionally a specific relational operator.

Version:
$Revision: 1.6 $ $Date: 2009/11/24 00:01:56 $ $Author: rnado $
Author:
Ron van Hoof

Field Summary
static byte ASSERTED
          Indicates that a statement is successfully asserted and no retraction was caused
static byte EXISTED
          Indicates that a statement was not asserted due to the fact that it already exists in the set
static byte NOT_FOUND
          Indicates the unsuccessfull retraction of a statement bc it was not found
static byte RETRACTED
          Indicates that a statement is successfully retracted, used with assertStatement it indicates that a statement was retracted bc of the assertion of a new statement to replace a value.
 
Method Summary
 byte assertStatement(VMStatementCtx s, long time)
          Asserts the specified statement in the statement set.
 void clear()
          Clears the statement set, removing all the statements from the statement set.
 boolean containsStatement(Statement statement)
          Checks if a statement with the same contents as the specified contents exists in the statement set.
 VMStatementCtx getAssertedStatement()
          Returns the asserted statement that resulted from the last assert.
 java.util.ListIterator getRetractedStatements()
          Returns the retracted statements that resulted from the last action (assert or retraction).
 VMStatementCtx getStatement(Concept lhsConcept, Relation relation, java.lang.Object rhsConcept, int truthValue)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation, java.lang.Object value)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int relation, java.lang.Object value)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation, java.lang.Object value)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatementForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 VMStatementCtx getStatementForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex)
          Find the statement using the specified parameters and return the statement if found, null if the statement was not found.
 java.util.ListIterator getStatements()
          Returns a list of all the statements in the statement set.
 java.util.ListIterator getStatements(Attribute attribute)
          Returns a list of all the statements that have the specified attribute regardless of their left and right hand side values.
 java.util.ListIterator getStatements(Concept lhsConcept, Relation relation)
          Returns a list of all the statements that have the specified left hand side concept and relation regardless of their right hand side concept.
 java.util.ListIterator getStatements(Concept lhsConcept, Relation relation, int truthvalue)
          Returns a list of all the statements that have the specified left hand side concept, relation and truth value regardless of their right hand side concept.
 java.util.ListIterator getStatements(Concept lhsConcept, Relation relation, java.lang.Object rhsConcept, int truthvalue)
          Returns a list of all the statements that have the specified left hand side concept, relation, right hand side concept, and truth value.
 java.util.ListIterator getStatements(java.lang.Object object)
          Returns a list of all the statements that have the specified object in either their left or right hand side.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute)
          Returns a list of all the statements that have the specified concept and attribute on their left hand side regardless of their relational operator or value.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int relation)
          Returns a list of all the statements that have the specified concept and attribute on their left hand side and that use the specified relational operator.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation)
          Find and return the statements using the specified parameters.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation, java.lang.Object value)
          Find and return the statements using the specified parameters.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int relation, java.lang.Object value)
          Find the statement(s) using the specified parameters and return the statement(s) if found.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation)
          Find and return the statements using the specified parameters.
 java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation, java.lang.Object value)
          Find and return the statements using the specified parameters.
 java.util.ListIterator getStatements(Relation relation)
          Returns a list of all the statements that have the specified relation regardless of their left and right hand side concept.
 java.util.ListIterator getStatements(Relation relation, java.lang.Object rhsConcept, int truthvalue)
          Returns a list of all the statements that have the specified relation and right hand side concept, and truth value regardless of their left hand side concept.
 java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex)
          Find and return the statements using the specified parameters.
 java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex)
          Find and return the statements using the specified parameters.
 boolean hasAssertedStatement()
          Indicates whether the last action performed on the statement set was an assertion.
 boolean hasRetractedStatement()
          Indicates whether the last action performed on the statement set was a retraction.
 byte retractStatement(VMStatementCtx s, long time)
          Retracts the specified statement from the statement set.
 

Field Detail

ASSERTED

static final byte ASSERTED
Indicates that a statement is successfully asserted and no retraction was caused

See Also:
Constant Field Values

EXISTED

static final byte EXISTED
Indicates that a statement was not asserted due to the fact that it already exists in the set

See Also:
Constant Field Values

RETRACTED

static final byte RETRACTED
Indicates that a statement is successfully retracted, used with assertStatement it indicates that a statement was retracted bc of the assertion of a new statement to replace a value.

See Also:
Constant Field Values

NOT_FOUND

static final byte NOT_FOUND
Indicates the unsuccessfull retraction of a statement bc it was not found

See Also:
Constant Field Values
Method Detail

assertStatement

byte assertStatement(VMStatementCtx s,
                     long time)
                     throws VMException
Asserts the specified statement in the statement set. If no rhs value exists for the statement it returns ASSERTED to indicate successful assertion. If a value for the statement exists and it is identical the statement is not asserted and the method returns EXISTED. If a value exists but it is different and the attribute or relation is single valued the statement with the old value is retracted followed by the assertion of the new statement. In this case the method returns RETRACTED. Using the method getRetractedStatement the retracted statement can be retrieved.

Note:If a statement already exists it does not necessarily mean it is the exact same object that is passed to the assert method. The assertion analyzes the contents of the statement and on first assertion uses that object. If a second object has the same contents it is not added to the set. So be aware not to count on identical objects.

Parameters:
s - the Statement to be asserted to the statement set
time - the time at which the assertion is performed
Returns:
byte ASSERTED if successful assertion with no retraction of an old value, EXISTED if no assertion took place bc the value already exists for a single valued attribute/relation RETRACTED if successful assertion but with a retraction of a statement bc an existing value was to be overwritten
Throws:
VMException - if an internal error occurs
See Also:
ASSERTED, EXISTED, RETRACTED, getRetractedStatements(), hasRetractedStatement()

retractStatement

byte retractStatement(VMStatementCtx s,
                      long time)
                      throws VMException
Retracts the specified statement from the statement set. If the statement is successfully removed the method returns RETRACTED. If the specified statement could not be found the method returns NOT_FOUND.

Note:The specified statement is merely analyzed for its contents in order to retract a statement. It does not necessarily mean that this actual object is searched for and removed. It could be another statement object representing the same statement.

Parameters:
s - the statement to be retracted
time - the time at which the retraction is performed
Returns:
byte RETRACTED if the statement is successfully retracted NOT_FOUND if the statement could not be found and was therefor not retracted
Throws:
VMException - if an internal error occurs
See Also:
RETRACTED, NOT_FOUND

hasAssertedStatement

boolean hasAssertedStatement()
Indicates whether the last action performed on the statement set was an assertion. This method can be used instead of the ASSERTED/EXISTED/RETRACTED indicator that is returned on assertion of a statement. Using getAssertedStatement the last asserted statement can be retrieved.

Returns:
true if the last assert caused an assertion (assertStatement returned ASSERTED or RETRACTED), false otherwise (assertStatement returned EXISTED or retractStatement was executed last).

getAssertedStatement

VMStatementCtx getAssertedStatement()
Returns the asserted statement that resulted from the last assert. If no assert has taken place it returns null.

Returns:
VMStatementCtx the statement asserted as a result of the last action, null if no assertion took place last.

hasRetractedStatement

boolean hasRetractedStatement()
Indicates whether the last action performed on the statement set was a retraction. This method can be used instead of the RETRACTED indicator that is returned on assertion of a statement. Using getRetractedStatement the last retracted statement can be retrieved.

Returns:
true if the last action (assert or retract) caused a retraction, false otherwise

getRetractedStatements

java.util.ListIterator getRetractedStatements()
Returns the retracted statements that resulted from the last action (assert or retraction). If no retract has taken place it returns an empty list.

Returns:
ListIterator the list of statements retracted as a result of the last action, an empty list if no retraction took place.

getStatements

java.util.ListIterator getStatements()
Returns a list of all the statements in the statement set.

Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(Attribute attribute)
Returns a list of all the statements that have the specified attribute regardless of their left and right hand side values.

Parameters:
attribute - the Attribute in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(java.lang.Object object)
Returns a list of all the statements that have the specified object in either their left or right hand side.

Parameters:
object - the Object in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     int lhsCollectionIndex,
                                     int relation,
                                     java.lang.Object value)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
ListIterator the list of matching statements
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     java.lang.String lhsCollectionIndex,
                                     int relation,
                                     java.lang.Object value)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
ListIterator the list of matching statements
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     int relation,
                                     java.lang.Object value)
Find the statement(s) using the specified parameters and return the statement(s) if found. Multiple statements can be found if the lhsObject is a concept of a class type or if the attribute is of a collection type and the value matches for multiple indexes/keys. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     int lhsCollectionIndex,
                                     int relation)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     java.lang.String lhsCollectionIndex,
                                     int relation)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatementsForIndex

java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject,
                                             Attribute lhsAttribute,
                                             int lhsCollectionIndex)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatementsForIndex

java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject,
                                             Attribute lhsAttribute,
                                             java.lang.String lhsCollectionIndex)
Find and return the statements using the specified parameters. Multiple statements can be found if the lhsObject is a concept of a class type. If the lhsObject is a concept of a class type then all statements of which the lhs concept matches the type of the specified lhsObject will be returned provided the the other parameters match.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(java.lang.Object lhsObject,
                            Attribute lhsAttribute,
                            int lhsCollectionIndex,
                            int relation,
                            java.lang.Object value)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(java.lang.Object lhsObject,
                            Attribute lhsAttribute,
                            java.lang.String lhsCollectionIndex,
                            int relation,
                            java.lang.Object value)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Concept in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(java.lang.Object lhsObject,
                            Attribute lhsAttribute,
                            int relation,
                            java.lang.Object value)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
relation - the relational operator in the requested statement
value - the right hand side value to match
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(java.lang.Object lhsObject,
                            Attribute lhsAttribute,
                            java.lang.String lhsCollectionIndex,
                            int relation)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(java.lang.Object lhsObject,
                            Attribute lhsAttribute,
                            int lhsCollectionIndex,
                            int relation)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
relation - the relational operator in the requested statement
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatementForIndex

VMStatementCtx getStatementForIndex(java.lang.Object lhsObject,
                                    Attribute lhsAttribute,
                                    int lhsCollectionIndex)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the integer index/key if the attribute's type is a collection
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatementForIndex

VMStatementCtx getStatementForIndex(java.lang.Object lhsObject,
                                    Attribute lhsAttribute,
                                    java.lang.String lhsCollectionIndex)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsObject - the left hand side Object in the requested statement
lhsAttribute - the left hand side Attribute in the requested statement
lhsCollectionIndex - the String index/key if the attribute's type is a collection
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatement

VMStatementCtx getStatement(Concept lhsConcept,
                            Relation relation,
                            java.lang.Object rhsConcept,
                            int truthValue)
Find the statement using the specified parameters and return the statement if found, null if the statement was not found.

Parameters:
lhsConcept - the left hand side Concept in the requested statement
relation - the Relation in the requested statement
rhsConcept - the right hand side Concept in the requested statement or the value unknown
truthValue - the truth value in the requested statement (TRUE, FALSE, UNKNOWN)
Returns:
VMStatementCtx if the matching statement is found, null otherwise
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN, IConstants.unknown

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute)
Returns a list of all the statements that have the specified concept and attribute on their left hand side regardless of their relational operator or value. If the lhs concept is a class type concept the method will return all statements for the concepts instances that are instances of the specified lhs concept.

Parameters:
lhsObject - the left hand side Object in the requested statement(s)
lhsAttribute - the left hand side Attribute in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(java.lang.Object lhsObject,
                                     Attribute lhsAttribute,
                                     int relation)
Returns a list of all the statements that have the specified concept and attribute on their left hand side and that use the specified relational operator. If the lhs concept is a class type concept the method will return all statements for the concepts instances that are instances of the specified lhs concept.

Parameters:
lhsObject - the left hand side Object in the requested statement(s)
lhsAttribute - the left hand side Attribute in the requested statement(s)
relation - the relational operator in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.EQ, IConstants.NE, IConstants.GT, IConstants.GE, IConstants.LT, IConstants.LE

getStatements

java.util.ListIterator getStatements(Relation relation)
Returns a list of all the statements that have the specified relation regardless of their left and right hand side concept.

Parameters:
relation - the Relation in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(Concept lhsConcept,
                                     Relation relation)
Returns a list of all the statements that have the specified left hand side concept and relation regardless of their right hand side concept. If the lhs concept is a class type concept the method will return all statements for the concepts instances that are instances of the specified lhs concept.

Parameters:
lhsConcept - the left hand side Concept in the requested statement(s)
relation - the Relation in the requested statement(s)
Returns:
ListIterator a list of VMStatementCtx's

getStatements

java.util.ListIterator getStatements(Concept lhsConcept,
                                     Relation relation,
                                     int truthvalue)
Returns a list of all the statements that have the specified left hand side concept, relation and truth value regardless of their right hand side concept. If the lhs concept is a class type concept the method will return all statements for the concepts instances that are instances of the specified lhs concept.

Parameters:
lhsConcept - the left hand side Concept in the requested statement(s)
relation - the Relation in the requested statement(s)
truthvalue - the truth value in the requested statement(s) (TRUE, FALSE, UNKNOWN)
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

getStatements

java.util.ListIterator getStatements(Relation relation,
                                     java.lang.Object rhsConcept,
                                     int truthvalue)
Returns a list of all the statements that have the specified relation and right hand side concept, and truth value regardless of their left hand side concept. If the rhs concept is a class type concept the method will return all statements for the concepts instances that are instances of the specified rrs concept.

Parameters:
relation - the Relation in the requested statement(s)
rhsConcept - the right hand side Concept in the requested statement(s) or the value unknown
truthvalue - the truth value in the requested statement(s) (TRUE, FALSE, UNKNOWN)
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN, IConstants.unknown

getStatements

java.util.ListIterator getStatements(Concept lhsConcept,
                                     Relation relation,
                                     java.lang.Object rhsConcept,
                                     int truthvalue)
Returns a list of all the statements that have the specified left hand side concept, relation, right hand side concept, and truth value. If either the lhs concept or the rhs concept is a class type concept the method will return all statements involving concepts that are instances of the specified lhs or rhs concept.

Parameters:
lhsConcept - the left hand side Concept in the requested statement(s)
relation - the Relation in the requested statement(s)
rhsConcept - the right hand side Concept in the requested statement(s) or the value unknown
truthvalue - the truth value in the requested statement(s) (TRUE, FALSE, UNKNOWN)
Returns:
ListIterator a list of VMStatementCtx's
See Also:
IConstants.TRUE, IConstants.FALSE, IConstants.UNKNOWN

containsStatement

boolean containsStatement(Statement statement)
Checks if a statement with the same contents as the specified contents exists in the statement set. If so true will be returned, if not false will be returned.

Note that this method does not check whether the statement set contains the same statement reference as specified for this method, it only compares the contents of the statement to the statements in this statement set.

Parameters:
statement - the statement to be checked
Returns:
boolean true if the statement set contains a statement with the same contents, false otherwise

clear

void clear()
Clears the statement set, removing all the statements from the statement set.



Copyright © 1997-2012 All Rights Reserved.