|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.parser2d.BasicConstraint
public class BasicConstraint
An object that returns whether a pair of rectangles satisfies constraints on the values of a specified relation. Constraints are specified as a range from minimum to maximum value, inclusive. Constants NO_MIN_CONSTRAINT and NO_MAX_CONSTRAINT are used to specify an open range in either or both directions.
Field Summary | |
---|---|
static double |
NO_MAX_CONSTRAINT
Use this constant to specify no maximum constraint for a particular relation. |
static double |
NO_MIN_CONSTRAINT
Use this to constant specify no minimum constraint for a particular relation. |
Constructor Summary | |
---|---|
BasicConstraint(Relation r,
double minVal,
double maxVal)
Create the constraints object with the given relations and given min/max constraints. |
Method Summary | |
---|---|
static void |
debug(String s)
Debugging output. |
static double |
parseMinMax(String s)
Parse a number string, NO_MIN, or NO_MAX into the corresponding range boundary. |
static String |
printMinMax(double d)
Parse a number string, NO_MIN, or NO_MAX into the corresponding range boundary. |
boolean |
test(SceneElement e1,
SceneElement e2)
Test the constraint on the given elements; return true if all constraints are met, false otherwise. |
String |
toString()
Print out the contents of this constraint. |
String |
toString(String e1Name,
String e2Name)
Print out the contents of this constraint in a grammar format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static double NO_MAX_CONSTRAINT
public static double NO_MIN_CONSTRAINT
Constructor Detail |
---|
public BasicConstraint(Relation r, double minVal, double maxVal)
Method Detail |
---|
public static void debug(String s)
public static double parseMinMax(String s)
public static String printMinMax(double d)
public boolean test(SceneElement e1, SceneElement e2)
test
in interface RelationConstraint
public String toString(String e1Name, String e2Name)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |