ValidationFunction<T>
public class DuplicatedMathValidationFunction<T extends MathContainer> extends java.lang.Object implements ValidationFunction<T>
In some cases, check as well if at least one 'math' element is present
Constructor | Description |
---|---|
DuplicatedMathValidationFunction() |
Creates a new
DuplicatedElementValidationFunction instance. |
DuplicatedMathValidationFunction(boolean mathIsRequired) |
Creates a new
DuplicatedElementValidationFunction instance. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
check(ValidationContext ctx,
T mathContainer) |
Returns
true if the constraint is valid and false
if it's broken. |
public DuplicatedMathValidationFunction()
DuplicatedElementValidationFunction
instance.public DuplicatedMathValidationFunction(boolean mathIsRequired)
DuplicatedElementValidationFunction
instance.mathIsRequired
- boolean to indicates if the math is required of not. It allows to differentiate rules that
tell "must have one and only one math element", from rules that tell "may have one and only one math element". Or
make the math required for some elements for SBML Level 3 if required.public boolean check(ValidationContext ctx, T mathContainer)
ValidationFunction
true
if the constraint is valid and false
if it's broken.check
in interface ValidationFunction<T extends MathContainer>
ctx
- the context in which the validation is performedmathContainer
- the object to checkfalse
if the constraint is broken