|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
---|
static final byte ASSERTED
static final byte EXISTED
static final byte RETRACTED
static final byte NOT_FOUND
Method Detail |
---|
byte assertStatement(VMStatementCtx s, long time) throws VMException
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.
s
- the Statement to be asserted to the statement settime
- the time at which the assertion is performed
VMException
- if an internal error occursASSERTED
,
EXISTED
,
RETRACTED
,
getRetractedStatements()
,
hasRetractedStatement()
byte retractStatement(VMStatementCtx s, long time) throws VMException
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.
s
- the statement to be retractedtime
- the time at which the retraction is performed
VMException
- if an internal error occursRETRACTED
,
NOT_FOUND
boolean hasAssertedStatement()
VMStatementCtx getAssertedStatement()
boolean hasRetractedStatement()
java.util.ListIterator getRetractedStatements()
java.util.ListIterator getStatements()
java.util.ListIterator getStatements(Attribute attribute)
attribute
- the Attribute in the requested statement(s)
java.util.ListIterator getStatements(java.lang.Object object)
object
- the Object in the requested statement(s)
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation, java.lang.Object value)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation, java.lang.Object value)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int relation, java.lang.Object value)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statement
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statement
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collection
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatementsForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collection
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation, java.lang.Object value)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation, java.lang.Object value)
lhsObject
- the left hand side Concept in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int relation, java.lang.Object value)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementrelation
- the relational operator in the requested statementvalue
- the right hand side value to match
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex, int relation)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statement
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex, int relation)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collectionrelation
- the relational operator in the requested statement
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatementForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, int lhsCollectionIndex)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the integer index/key if the attribute's type is a collection
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatementForIndex(java.lang.Object lhsObject, Attribute lhsAttribute, java.lang.String lhsCollectionIndex)
lhsObject
- the left hand side Object in the requested statementlhsAttribute
- the left hand side Attribute in the requested statementlhsCollectionIndex
- the String index/key if the attribute's type is a collection
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
VMStatementCtx getStatement(Concept lhsConcept, Relation relation, java.lang.Object rhsConcept, int truthValue)
lhsConcept
- the left hand side Concept in the requested statementrelation
- the Relation in the requested statementrhsConcept
- the right hand side Concept in the requested statement or the value unknowntruthValue
- the truth value in the requested statement (TRUE, FALSE, UNKNOWN)
IConstants.TRUE
,
IConstants.FALSE
,
IConstants.UNKNOWN
,
IConstants.unknown
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute)
lhsObject
- the left hand side Object in the requested statement(s)lhsAttribute
- the left hand side Attribute in the requested statement(s)
java.util.ListIterator getStatements(java.lang.Object lhsObject, Attribute lhsAttribute, int relation)
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)
IConstants.EQ
,
IConstants.NE
,
IConstants.GT
,
IConstants.GE
,
IConstants.LT
,
IConstants.LE
java.util.ListIterator getStatements(Relation relation)
relation
- the Relation in the requested statement(s)
java.util.ListIterator getStatements(Concept lhsConcept, Relation relation)
lhsConcept
- the left hand side Concept in the requested statement(s)relation
- the Relation in the requested statement(s)
java.util.ListIterator getStatements(Concept lhsConcept, Relation relation, int truthvalue)
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)
IConstants.TRUE
,
IConstants.FALSE
,
IConstants.UNKNOWN
java.util.ListIterator getStatements(Relation relation, java.lang.Object rhsConcept, int truthvalue)
relation
- the Relation in the requested statement(s)rhsConcept
- the right hand side Concept in the requested statement(s) or the value unknowntruthvalue
- the truth value in the requested statement(s) (TRUE, FALSE, UNKNOWN)
IConstants.TRUE
,
IConstants.FALSE
,
IConstants.UNKNOWN
,
IConstants.unknown
java.util.ListIterator getStatements(Concept lhsConcept, Relation relation, java.lang.Object rhsConcept, int truthvalue)
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 unknowntruthvalue
- the truth value in the requested statement(s) (TRUE, FALSE, UNKNOWN)
IConstants.TRUE
,
IConstants.FALSE
,
IConstants.UNKNOWN
boolean containsStatement(Statement statement)
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.
statement
- the statement to be checked
void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |