|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for objects that provide an implementation for constraints. These object understand how to encode and decode an integer encoding of a constraint (or maintain such a coding inside themselves), and use that to perform operations such as evaluate the constraint, determine if it depends upon a particular value, produce a human readable rendition of the constraint, etc.
For constraint implementations that do not encode the constraints inside the object, there is typically only one instance of each constraint implementation which is shared by all constraints encoded in the same form (this is true for example of std_constraint_impl).
constraints.std_constraint_impl
Method Summary | |
java.util.Vector |
depend_list(int enc,
interactor constr_obj,
int orient)
Extract the set of objects/parts that a constraint depends on. |
boolean |
depends_on(int enc,
interactor constr_obj,
int which_obj,
int which_part,
int nth_child,
int orient)
Test whether the given encoded constraint depends on the indicated neighboring object and part. |
int |
eval(int enc,
interactor constr_obj,
int constr_part,
int orient)
Evaluate an encoded constraint (under a given orientation). |
java.util.Vector |
implicit_depend_list(int enc,
interactor constr_obj,
int orient)
Extract the dependencies that are implicit in the particular operation encoded in the given standard constraint encoding. |
boolean |
is_external(int enc)
Determine if a given constraint encoding represents an external (aka heavyweight) constraint. |
boolean |
is_none(int enc)
Determine if a given constraint encoding represents "none" (i.e., that no constraint is to be applied). |
java.lang.String |
str_for(int enc,
int orient)
Create a human readable string corresponding to the given constraint encoding. |
java.lang.String |
tag_for(int enc,
int orient)
Create a terse human readable string corresponding to the given constraint encoding. |
Method Detail |
public java.lang.String str_for(int enc, int orient)
int
- enc the constraint encodingint
- orient the orientation of the constraintpublic java.lang.String tag_for(int enc, int orient)
int
- enc the constraint encodingint
- orient the orientation of the constraintpublic boolean is_none(int enc)
int
- enc the encoding for the constraint.public boolean is_external(int enc)
int
- enc the encoding for the constraint.public int eval(int enc, interactor constr_obj, int constr_part, int orient)
int
- enc the encoding of the constraintinteractor
- constr_obj the object being constrainedint
- constr_part the part being constrainedint
- orient the orientation of the constraintpublic boolean depends_on(int enc, interactor constr_obj, int which_obj, int which_part, int nth_child, int orient)
If this is an "external" constraint that maintains its own dependency edges and works through the external notification system, then this method may safely return false in all cases.
int
- enc The encoding for the constraint.interactor
- constr_obj The object the constraint is attached toint
- test_which_obj The neighboring object we are asking
about. This can be one of the values
OBJCODE_SELF, OBJCODE_PARENT,
OBJCODE_SOME_CHILD,
OBJCODE_PREV_SIBLING, or
OBJCODE_NEXT_SIBLING.int
- test_which_part The part we are asking about.int
- nth_child for SOME_CHILD, this provides the index
of the child (and is ignored otherwise).int
- orient Orientation of the constraint. This
should be HORIZONTAL or VERTICAL.public java.util.Vector depend_list(int enc, interactor constr_obj, int orient)
int
- enc encoding value for the constraint in question.interactor
- constr_obj the object the constraint is attached to
(hence its referents are relative to).int
- orient Orientation of the constraint. This
should be HORIZONTAL or VERTICAL.public java.util.Vector implicit_depend_list(int enc, interactor constr_obj, int orient)
int
- enc encoding value for the constraint in question.interactor
- constr_obj the object the constraint is attached to
(hence its referents are relative to).int
- orient Orientation of the constraint. This
should be HORIZONTAL or VERTICAL.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |