Package org.cip4.jdflib.datatypes
Class JDFXYPairRange
java.lang.Object
org.cip4.jdflib.datatypes.JDFRange
org.cip4.jdflib.datatypes.JDFXYPairRange
- All Implemented Interfaces:
JDFBaseDataTypes
This class represents a x y pair range (JDFXYPairRange). It is a whitespace separated list of 2 xy pairs separated by a tilde "~", for example "1.23 3.24 ~ 2.34 7.12"
-
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 xy pair range with all values set to 0.0 Doubleconstructs a xy pair range with all values set via a stringconstructs a xy pair range with both values equal ("from x to x")constructs a xy pair range with the given xy pair rangeJDFXYPairRange(JDFXYPair min, JDFXYPair max) constructs a xy pair range with the given left and right xy pair -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals - returns true if both JDFXYPaiRanges are equal otherwise falsegetLeft()getLeft - returns the left JDFXYPair objectprotected ObjectgetLeftString(int precision) getLowerValue - returns the lower value of the boundsdoublegetLowerXValue - returns the lower x value of the bounds for example 2.9 4.5~6.3 7.9 return 2.9doublegetLowerYValue - returns the lower y value of the bounds for example 2.9 4.5~6.3 7.9 return 4.5getRight()getRight - returns the right JDFXYPair objectprotected ObjectgetRightString(int precision) getUpperValue - returns the upper value of the boundsdoublegetUpperXValue - return the upper x value of the bounds for example 2.9 4.5~6.3 7.9 return 6.3doublegetUpperYValue - return the upper y value of the bounds for example 2.9 4.5~6.3 7.9 return 7.9inthashCode()hashCode complements equals() to fulfill the equals/hashCode contractprotected voidInitializationprotected booleaninObjectRange(Object other) booleaninRange - returns true ifthiscontainsxypairbooleanisEqual - boolean equivalencebooleanisPartOfRange - is range 'r' within this range?booleanisValid - validate the given Stringvoidsets the left JDFXYPair object of the rangevoidsets the right JDFXYPair object of the rangeMethods inherited from class org.cip4.jdflib.datatypes.JDFRange
getString, getXJDFString, toString
-
Constructor Details
-
JDFXYPairRange
public JDFXYPairRange()constructs a xy pair range with all values set to 0.0 Double -
JDFXYPairRange
constructs a xy pair range with both values equal ("from x to x")- Parameters:
x- left/right pair
-
JDFXYPairRange
constructs a xy pair range with the given left and right xy pair- Parameters:
min- the given left xy pairmax- the given right xy pair
-
JDFXYPairRange
constructs a xy pair range with the given xy pair range- Parameters:
JDFXYPairRange- r - the given xy pair range
-
JDFXYPairRange
constructs a xy pair range with all values set via a string- Parameters:
s- the given string- Throws:
DataFormatException- - if the String has not a valid format
-
-
Method Details
-
init
Initialization- Parameters:
min-max-
-
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 JDFXYPaiRanges are equal otherwise false -
hashCode
public int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract -
getLeft
getLeft - returns the left JDFXYPair object- Returns:
- JDFXYPair - the left JDFXYPair object
-
getRight
getRight - returns the right JDFXYPair object- Returns:
- JDFXYPair - the right JDFXYPair object
-
setLeft
sets the left JDFXYPair object of the range- Parameters:
xy- the left JDFXYPair object of the range
-
setRight
sets the right JDFXYPair object of the range- Parameters:
xy- the right JDFXYPair object of the range
-
getLowerXValue
public double getLowerXValue()getLowerXValue - returns the lower x value of the bounds for example 2.9 4.5~6.3 7.9 return 2.9- Returns:
- double - the lower x value of the range
-
getUpperXValue
public double getUpperXValue()getUpperXValue - return the upper x value of the bounds for example 2.9 4.5~6.3 7.9 return 6.3- Returns:
- double - the upper x value of the range
-
getLowerYValue
public double getLowerYValue()getLowerYValue - returns the lower y value of the bounds for example 2.9 4.5~6.3 7.9 return 4.5- Returns:
- double - the lower y value of the range
-
getUpperYValue
public double getUpperYValue()getUpperYValue - return the upper y value of the bounds for example 2.9 4.5~6.3 7.9 return 7.9- Returns:
- double - the upper y value of the range
-
getUpperValue
getUpperValue - returns the upper value of the bounds- Returns:
- JDFXYPair - the upper value of the range
-
getLowerValue
getLowerValue - returns the lower value of the bounds- Returns:
- JDFXYPair - the lower value of the range
-
isEqual
isEqual - boolean equivalence- Returns:
- boolean - true if the ranges are equivalent
-
inRange
inRange - returns true ifthiscontainsxypair- Parameters:
xypair- comparison pair- Returns:
- boolean - true if xy in range
-
isPartOfRange
isPartOfRange - is range 'r' within this range?- Specified by:
isPartOfRangein classJDFRange- Parameters:
ra- the range to test- Returns:
- boolean - true if range 'r' is within this range, else false
-
getRightObject
- Specified by:
getRightObjectin classJDFRange
-
getRightString
- Overrides:
getRightStringin classJDFRange
-
getLeftString
- Overrides:
getLeftStringin classJDFRange
-
getLeftObject
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
- Overrides:
inObjectRangein classJDFRange
-