Class DRedTcRelation<V>
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.base.itc.alg.dred.DRedTcRelation<V>
-
- All Implemented Interfaces:
ITcRelation<V>
public class DRedTcRelation<V> extends java.lang.Object implements ITcRelation<V>
-
-
Constructor Summary
Constructors Constructor Description DRedTcRelation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addTuple(V source, V target)
Returns true if the tc relation did not contain previously such a tuple that is defined by (source,target), false otherwise.void
clear()
boolean
containsTuple(V source, V target)
Returns true if a (source, target) node is present in the transitive closure relation, false otherwise.void
difference(DRedTcRelation<V> rA)
Computes the difference of this tc relation and the given rA parameter.boolean
equals(java.lang.Object obj)
java.util.Set<V>
getTupleEnds(V source)
Returns the set of nodes that are reachable from the given node.java.util.Map<V,java.util.Set<V>>
getTuplesForward()
java.util.Set<V>
getTupleStarts()
Returns the starting nodes from a transitive closure relation.java.util.Set<V>
getTupleStarts(V target)
Returns the set of nodes from which the target node is reachable.int
hashCode()
boolean
isEmpty()
void
removeTuple(V source, V target)
java.lang.String
toString()
void
union(DRedTcRelation<V> rA)
Union operation of two tc realtions.
-
-
-
Method Detail
-
clear
public void clear()
-
isEmpty
public boolean isEmpty()
-
addTuple
public boolean addTuple(V source, V target)
Returns true if the tc relation did not contain previously such a tuple that is defined by (source,target), false otherwise.- Parameters:
source
- the source of the tupletarget
- the target of the tuple- Returns:
- true if the relation did not contain previously the tuple
-
union
public void union(DRedTcRelation<V> rA)
Union operation of two tc realtions.- Parameters:
rA
- the other tc relation
-
difference
public void difference(DRedTcRelation<V> rA)
Computes the difference of this tc relation and the given rA parameter.- Parameters:
rA
- the subtrahend relation
-
getTupleEnds
public java.util.Set<V> getTupleEnds(V source)
Description copied from interface:ITcRelation
Returns the set of nodes that are reachable from the given node.- Specified by:
getTupleEnds
in interfaceITcRelation<V>
- Parameters:
source
- the starting node- Returns:
- the set of reachable nodes
-
getTupleStarts
public java.util.Set<V> getTupleStarts(V target)
Returns the set of nodes from which the target node is reachable.- Parameters:
target
- the target node- Returns:
- the set of source nodes
-
getTupleStarts
public java.util.Set<V> getTupleStarts()
Description copied from interface:ITcRelation
Returns the starting nodes from a transitive closure relation.- Specified by:
getTupleStarts
in interfaceITcRelation<V>
- Returns:
- the set of starting nodes
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
containsTuple
public boolean containsTuple(V source, V target)
Returns true if a (source, target) node is present in the transitive closure relation, false otherwise.- Parameters:
source
- the source nodetarget
- the target node- Returns:
- true if tuple is present, false otherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-