Class CountingTcRelation<V>
java.lang.Object
tools.refinery.interpreter.rete.itc.alg.counting.CountingTcRelation<V>
- Type Parameters:
- V-
- All Implemented Interfaces:
- ITcRelation<V>
Transitive closure relation implementation for the Counting algorithm.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns true if the tc relation did not contain previously such a tuple that is defined by (source,target), false otherwise (in this case count is incremented with the given count parameter).protected voidclear()booleancontainsTuple(V source, V target) Returns true if a (source, target) node is present in the transitive closure relation, false otherwise.static <V> CountingTcRelation<V> voiddeleteTupleEnd(V deleted) booleanintgetTupleEnds(V source) Returns the set of nodes that are reachable from the given node.Returns the starting nodes from a transitive closure relation.getTupleStarts(V target) Returns the set of nodes from which the target node is reachable, if already computed.inthashCode()protected booleanisEmpty()toString()protected voidunion(CountingTcRelation<V> rA) booleanupdateTuple(V source, V target, boolean isInsertion) Derivation count of the tuple (source,target) is incremented or decremented.
- 
Constructor Details- 
CountingTcRelationprotected CountingTcRelation(boolean backwardIndexing) 
 
- 
- 
Method Details- 
isEmptyprotected boolean isEmpty()
- 
clearprotected void clear()
- 
union
- 
getCount
- 
addTupleReturns true if the tc relation did not contain previously such a tuple that is defined by (source,target), false otherwise (in this case count is incremented with the given count parameter).- Parameters:
- source- the source of the tuple
- target- the target of the tuple
- count- the count of the tuple, must be positive
- Returns:
- true if the relation did not contain previously the tuple
 
- 
updateTupleDerivation count of the tuple (source,target) is incremented or decremented. Returns true iff updated to / from zero derivation count.- Since:
- 1.7
 
- 
deleteTupleEnd
- 
toString
- 
getTupleEndsDescription copied from interface:ITcRelationReturns the set of nodes that are reachable from the given node.- Specified by:
- getTupleEndsin interface- ITcRelation<V>
- Parameters:
- source- the starting node
- Returns:
- the set of reachable nodes
 
- 
getTupleStartsReturns the set of nodes from which the target node is reachable, if already computed.- Parameters:
- target- the target node
- Returns:
- the set of source nodes
- Throws:
- UnsupportedOperationException- if backwards index not computed
 
- 
getTupleStartsDescription copied from interface:ITcRelationReturns the starting nodes from a transitive closure relation.- Specified by:
- getTupleStartsin interface- ITcRelation<V>
- Returns:
- the set of starting nodes
 
- 
containsTupleReturns true if a (source, target) node is present in the transitive closure relation, false otherwise.- Parameters:
- source- the source node
- target- the target node
- Returns:
- true if tuple is present, false otherwise
 
- 
equals
- 
hashCodepublic int hashCode()
- 
createFrom
 
-