|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.deri.iris.graph.PredicateGraph
public class PredicateGraph
A graph to determine the dependencies of rules and predicates to each other.
$Id$
| Method Summary | |
|---|---|
void |
addRule(Collection<IRule> r)
Adds a collection of rules to the graph. |
void |
addRule(IRule rule)
Adds a rule to the graph. |
int |
countNegativesForCycle()
Returns the number of negative Literals in the cycle. |
boolean |
detectCycles()
Determines whether the rules are recursive. |
Set<LabeledEdge<IPredicate,Boolean>> |
findEdgesForCycle()
Determines the edges contained in the cycle. |
Set<IPredicate> |
findVertexesForCycle()
Determines the vertexes contained in the cycle. |
Set<IPredicate> |
getDepends(IPredicate p)
Returns a set of predicates the given one depends on. |
Comparator<IPredicate> |
getPredicateComparator()
Returns a compareator which compares two predicates depending on their dependencies of their rules. |
Comparator<IRule> |
getRuleComparator()
Returs a comparator which compares two rules depending on their dependencies of each other. |
String |
toString()
Computes a short description of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void addRule(IRule rule)
IPredicateGraph
addRule in interface IPredicateGraphrule - the rule to addpublic void addRule(Collection<IRule> r)
IPredicateGraph
addRule in interface IPredicateGraphr - the collection of rulespublic boolean detectCycles()
IPredicateGraph
detectCycles in interface IPredicateGraphtrue if they are recursive, otherwise falsepublic Set<IPredicate> findVertexesForCycle()
IPredicateGraph
findVertexesForCycle in interface IPredicateGraphpublic Set<LabeledEdge<IPredicate,Boolean>> findEdgesForCycle()
IPredicateGraph
findEdgesForCycle in interface IPredicateGraphpublic int countNegativesForCycle()
IPredicateGraph
countNegativesForCycle in interface IPredicateGraphpublic Comparator<IRule> getRuleComparator()
IPredicateGraphReturs a comparator which compares two rules depending on their dependencies of each other.
The rules will compared according to their headpredicates.
getRuleComparator in interface IPredicateGraphIPredicateGraph.getPredicateComparator()public Comparator<IPredicate> getPredicateComparator()
IPredicateGraphReturns a compareator which compares two predicates depending on their dependencies of their rules.
If one of the compared predicate isn't in the graph, or there isn't a
path from one predicate to the other 0 will be returned. If the
first predicate depends on the second one, the first one will be
determined to be bigger, and vice versa.
getPredicateComparator in interface IPredicateGraphpublic Set<IPredicate> getDepends(IPredicate p)
IPredicateGraph
getDepends in interface IPredicateGraphp - predicate for which to check for dependencies
public String toString()
Computes a short description of this object. The format of the returned string is undocumented and subject to change..
And example return string could be:
a->(false)->b
b->(true)->c
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||