Package org.cip4.jdflib.datatypes
Class JDFShapeRange
java.lang.Object
org.cip4.jdflib.datatypes.JDFRange
org.cip4.jdflib.datatypes.JDFShapeRange
- All Implemented Interfaces:
JDFBaseDataTypes
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue -
Field Summary
Fields inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
EPSILON, MAX_CMYK_COLOR, MAX_LAB_COLOR, MAX_MATRIX_DIMENSION, MAX_RECTANGLE_DIMENSION, MAX_RGB_COLOR, MAX_SHAPE_DIMENSION, MAX_XY_DIMENSION -
Constructor Summary
ConstructorsConstructorDescriptionconstructs a shape pair range with all values set to 0.0 Doubleconstructs a JDFShapeRange with the values of the given Stringconstructs a JDFShapeRange, both values are equal ("from x to x")copy constructor
constructs a JDFShapeRange with the given JDFShapeRangeJDFShapeRange(JDFShape xmin, JDFShape xmax) constructor a JDFShapeRange with two JDFShape values ("from xmin to xmax") -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals - returns true if both JDFShapeRanges are equal otherwise falsegetLeft()getLeft - gets the left JDFShape object of the rangeprotected ObjectgetLeftString(int precision) getLowerValue - returns the lower value of the boundsgetRight()getRight - gets the right JDFShape object of the rangeprotected ObjectgetRightString(int precision) getUpperValue - returns the upper value of the boundsinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractprotected voidInitializationprotected booleaninObjectRange(Object other) booleaninRange - tests if the given x inside of this rangebooleanisPartOfRange - is range 'r' within this range?booleanisValid - validate the given Stringvoidsets the left JDFShape object of the rangevoidsets the right JDFShape object of the rangeMethods inherited from class org.cip4.jdflib.datatypes.JDFRange
getString, getXJDFString, toString
-
Constructor Details
-
JDFShapeRange
public JDFShapeRange()constructs a shape pair range with all values set to 0.0 Double -
JDFShapeRange
constructs a JDFShapeRange, both values are equal ("from x to x")- Parameters:
x- the given JDFShape
-
JDFShapeRange
constructor a JDFShapeRange with two JDFShape values ("from xmin to xmax")- Parameters:
xmin- the given min valuexmax- the given max value
-
JDFShapeRange
copy constructor
constructs a JDFShapeRange with the given JDFShapeRange- Parameters:
r-
-
JDFShapeRange
constructs a JDFShapeRange with the values of the given String- Parameters:
s- the given string representation of the range- Throws:
DataFormatException- - if the String has not a valid format
-
-
Method Details
-
getRightString
- Overrides:
getRightStringin classJDFRange
-
getLeftString
- Overrides:
getLeftStringin classJDFRange
-
init
Initialization- Parameters:
x- left boundaryy- right boundary
-
isValid
isValid - validate the given String- Parameters:
s- the given string- Returns:
- boolean - false if the String has not a valid format
-
equals
equals - returns true if both JDFShapeRanges are equal otherwise false -
hashCode
public int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract -
inRange
inRange - tests if the given x inside of this range- Parameters:
x- comparison value- Returns:
- boolean - true if x in range
-
isPartOfRange
isPartOfRange - is range 'r' within this range?- Specified by:
isPartOfRangein classJDFRange- Parameters:
r- the range to test- Returns:
- boolean - true if range 'r' is within this range, else false
-
getLeft
getLeft - gets the left JDFShape object of the range- Returns:
- JDFShape x - the left JDFShape object of the range
-
getRight
getRight - gets the right JDFShape object of the range- Returns:
- JDFShape x - the right JDFShape object of the range
-
setLeft
sets the left JDFShape object of the range- Parameters:
x- the left JDFShape object of the range
-
setRight
sets the right JDFShape object of the range- Parameters:
x- the right JDFShape object of the range
-
getUpperValue
getUpperValue - returns the upper value of the bounds- Returns:
- JDFShape - the upper value of the range
-
getLowerValue
getLowerValue - returns the lower value of the bounds- Returns:
- JDFShape - the lower value of the range
-
getRightObject
- Specified by:
getRightObjectin classJDFRange
-
getLeftObject
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
- Overrides:
inObjectRangein classJDFRange
-