Class ReasoningMonitorRelation
java.lang.Object
com.semedy.reasoner.reasoning.monitor.RelationAdapter
com.semedy.reasoner.reasoning.monitor.ReasoningMonitorRelation
- All Implemented Interfaces:
BaseRelation
,Relation
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addTuple
(int tupleaddress) add a tuple to the relationboolean
addTuple
(long[] tuple) add a tuple to the relationboolean
addTuple
(TupleBuffer terms) add a tuple to the relationvoid
clear()
remove all tuplesvoid
close()
Close the relation.static Relation[]
create
(ReasoningRelation... relations) static Relation[]
create
(List<ReasoningRelation> relations) createIndex
(int[] indexedpositions) Get or create a simple (not sorted index) by the argument positions in indexed positions.static Relation
createSingle
(ReasoningRelation relation) createSortedIndex
(int[] indexedpositions) ret or create a sorted index given by the argument positions in indexed positionselements()
returns an enumerator for all tuplesget the caching infolong[]
get an input buffer for relationlong
getNumberOfMatchingTuples
(int[] arguments, long[] values) boolean
removeTuple
(int tupleaddress) remove a tuple from the relationboolean
removeTuple
(TupleBuffer buffer) remove a tuple from the relationMethods inherited from class com.semedy.reasoner.reasoning.monitor.RelationAdapter
addSubRelation, checkSanity, containsTuple, containsTuple, containsTuple, delete, deSelect, elements, flush, getArity, getDataFilePath, getDirectEncodedType, getFilename, getGrounds, getIdentifier, getIndex, getInternalArity, getMaxValue, getMinValue, getName, getNumberOfDifferentValues, getNumberOfDifferentValues, getPredicateSymbol, getSortedIndex, hasDuplicates, hasIndices, isDirectEncoded, isEmpty, isOverwrittenByTuple, isPersistent, isTemporary, lastModificationTime, mayContainDuplicates, overwriteTuple, overwriteTuple, readBinaryFromBackup, readTupleFile, registerListener, removeIndices, removeTuple, select, size, sizeInBytes, subtractRelation, transactionBegin, transactionCommit, transactionRollback, union, unionRelation, writeBinary, writeBinaryToBackup, writeBinaryWithGrounds
-
Method Details
-
createSingle
-
create
-
create
-
elements
Description copied from interface:BaseRelation
returns an enumerator for all tuples- Specified by:
elements
in interfaceBaseRelation
- Overrides:
elements
in classRelationAdapter
- Returns:
- returns enumerator for tuples
- Throws:
IOException
EDBException
-
createSortedIndex
Description copied from interface:BaseRelation
ret or create a sorted index given by the argument positions in indexed positions- Specified by:
createSortedIndex
in interfaceBaseRelation
- Overrides:
createSortedIndex
in classRelationAdapter
- Returns:
- Throws:
IOException
-
createIndex
Description copied from interface:BaseRelation
Get or create a simple (not sorted index) by the argument positions in indexed positions.- Specified by:
createIndex
in interfaceBaseRelation
- Overrides:
createIndex
in classRelationAdapter
- Parameters:
indexedpositions
- , positions which are indexed- Returns:
- index
- Throws:
IOException
-
clear
Description copied from interface:BaseRelation
remove all tuples- Specified by:
clear
in interfaceBaseRelation
- Overrides:
clear
in classRelationAdapter
- Throws:
IOException
-
close
Description copied from interface:BaseRelation
Close the relation. Must be called to finalize the relation correctly- Specified by:
close
in interfaceBaseRelation
- Overrides:
close
in classRelationAdapter
- Throws:
IOException
-
getCacheInfo
Description copied from interface:BaseRelation
get the caching info- Specified by:
getCacheInfo
in interfaceBaseRelation
- Overrides:
getCacheInfo
in classRelationAdapter
- Returns:
- object containing caching info
-
addTuple
Description copied from interface:BaseRelation
add a tuple to the relation- Specified by:
addTuple
in interfaceBaseRelation
- Overrides:
addTuple
in classRelationAdapter
- Parameters:
terms
- the tuple to add- Returns:
- tuple has been added
- Throws:
IOException
-
addTuple
Description copied from interface:BaseRelation
add a tuple to the relation- Specified by:
addTuple
in interfaceBaseRelation
- Overrides:
addTuple
in classRelationAdapter
- Parameters:
tuple
- the tuple to add- Returns:
- tuple has been added
- Throws:
IOException
-
removeTuple
Description copied from interface:BaseRelation
remove a tuple from the relation- Specified by:
removeTuple
in interfaceBaseRelation
- Overrides:
removeTuple
in classRelationAdapter
- Parameters:
tupleaddress
- , address of tuple in tuple store- Returns:
- true, if tuple has been removed
- Throws:
IOException
-
removeTuple
Description copied from interface:BaseRelation
remove a tuple from the relation- Specified by:
removeTuple
in interfaceBaseRelation
- Overrides:
removeTuple
in classRelationAdapter
- Parameters:
buffer
- , tuple to be removed- Returns:
- true, if tuple has been removed
- Throws:
IOException
-
getInputBuffer
Description copied from interface:BaseRelation
get an input buffer for relation- Specified by:
getInputBuffer
in interfaceBaseRelation
- Overrides:
getInputBuffer
in classRelationAdapter
- Returns:
- a tuple store which serves as buffer for input tuples
-
addTuple
Description copied from interface:BaseRelation
add a tuple to the relation- Specified by:
addTuple
in interfaceBaseRelation
- Overrides:
addTuple
in classRelationAdapter
- Parameters:
tupleaddress
- the tuple to add- Returns:
- tuple has been added
- Throws:
IOException
-
getFilter
public long[] getFilter() -
getNumberOfMatchingTuples
public long getNumberOfMatchingTuples(int[] arguments, long[] values) throws IOException, EDBException - Overrides:
getNumberOfMatchingTuples
in classRelationAdapter
- Throws:
IOException
EDBException
-