public class ConstraintSimple extends Constraint
#ConstraintSimple(Individual, Type, Cons, CASAOntology, TransientAgent)
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ConstraintSimple.Individual |
Modifier and Type | Field and Description |
---|---|
(package private) TransientAgent |
agent |
private static CasaLispOperator |
CONSTRAINT
Java function definition to construct a SimpleConstraint.
CONSTRAINT &OPTIONAL TYPE-NAME java.lang.String; The type to constrain to. &KEY INDIVIDUAL-ONLY; java.lang.Boolean Constraint to being an individual only and not a type. TYPE-ONLY java.lang.Boolean; Constrain to being a type only and not an individual. |
(package private) Cons |
exp |
(package private) ConstraintSimple.Individual |
ind |
(package private) Ontology |
ont |
(package private) Type |
type |
Constructor and Description |
---|
ConstraintSimple(ConstraintSimple.Individual individual,
Type type,
Cons exp,
Ontology ont,
TransientAgent agent)
Constructs a SimpleConstraint.
|
Modifier and Type | Method and Description |
---|---|
String |
toString() |
boolean |
validate(Type type,
Type... types)
Validate the type in the context of a relation.
|
private boolean |
validateExp(Type type,
Type... types)
Validate an expression.
|
ConstraintSimple.Individual ind
Type type
Cons exp
Ontology ont
TransientAgent agent
private static final CasaLispOperator CONSTRAINT
public ConstraintSimple(ConstraintSimple.Individual individual, Type type, Cons exp, Ontology ont, TransientAgent agent)
validate(Type, Type...)
.
Although any of the parameters may be null, at least one of individual, type,
and exp must not be null.individual
- If the value is:
ConstraintSimple.Individual.Individual
: The validating type must be an Individual.
ConstraintSimple.Individual.Type
: The validating type must be an Type.
ConstraintSimple.Individual.Either
: The validating type can be either an Individual or a Type.
type
- The supertype that the validating type must be a subtype (isa) of
in order for evalutation to pass . May be null.exp
- A valid Lisp expression that must be return true for the evaluation to pass.
May be null. The expression may contain the following meta variables
(question marks are part of the meta variable names):
ont
- The ontology in which to interpret the constraint. May be null.agent
- The agent context in which to interpret the constraint. May be null.public boolean validate(Type type, Type... types)
validate
in class Constraint
type
- The type under examination.types
- The types involved in the relation (in order).Constraint.validate(Type, Type...)
,
#ConstraintSimple(Individual, Type, Cons, CASAOntology, TransientAgent)
private boolean validateExp(Type type, Type... types)
type
- types
-