adds a constraint to this node.
If the constraint contains attributes that are not yet present in the query graph, the query graph is extended accordingly.
Special behaviour for:
- class {@link Class}: confine the result to objects of one class (if the {@link Class} object represents a class)or to objects implementing a specific interface (if the {@link Class} object represents an interface).
- interface {@link Evaluation}: run evaluation callbacks against all candidates.
@param constraint the constraint to be added to this Query.
@return {@link Constraint} a new {@link Constraint} for thisquery node or
null
for objects implementing the {@link Evaluation} interface.