public class AssignmentCycleValidation extends java.lang.Object implements ValidationFunction<SBase>
Modifier and Type | Field and Description |
---|---|
private static boolean |
isDebugEnabled
A static boolean to avoid many unnecessary calls to
Category.isDebugEnabled() . |
private static org.apache.log4j.Logger |
logger
A
Logger for this class. |
private java.util.Queue<SBase> |
toCheck |
private java.util.Set<java.lang.String> |
visited |
Constructor and Description |
---|
AssignmentCycleValidation() |
Modifier and Type | Method and Description |
---|---|
boolean |
check(ValidationContext ctx,
SBase sb)
Returns
true if the constraint is valid and false
if it's broken. |
private void |
checkChildren(Model m,
ASTNode math) |
private void |
checkChildren(Model m,
MathContainer r) |
private void |
checkChildren(Model m,
Reaction r) |
private void |
checkChildren(Model m,
SBase sb) |
private java.lang.String |
getRelatedId(SBase sb)
Returns an id depending of the type of SBase given.
|
private java.util.Set<java.lang.String> visited
private java.util.Queue<SBase> toCheck
private static final transient org.apache.log4j.Logger logger
Logger
for this class.private static final transient boolean isDebugEnabled
Category.isDebugEnabled()
.public boolean check(ValidationContext ctx, SBase sb)
ValidationFunction
true
if the constraint is valid and false
if it's broken.check
in interface ValidationFunction<SBase>
false
if the constraint is brokenprivate java.lang.String getRelatedId(SBase sb)
Reaction
, returns reaction.id,
if it is an Assignment
, returns assignment.variable (symbol or variable attribute), if it is
a Species
, returns species.compartment. For any other type of SBase
, returns null.sb
- an SBase
private void checkChildren(Model m, MathContainer r)
m
- r
-