Package org.cip4.jdflib.datatypes
Class JDFShapeRange
- java.lang.Object
-
- org.cip4.jdflib.datatypes.JDFRange
-
- org.cip4.jdflib.datatypes.JDFShapeRange
-
- All Implemented Interfaces:
JDFBaseDataTypes
public class JDFShapeRange extends JDFRange
-
-
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
Constructors Constructor Description JDFShapeRange()constructs a shape pair range with all values set to 0.0 DoubleJDFShapeRange(java.lang.String s)constructs a JDFShapeRange with the values of the given StringJDFShapeRange(JDFShape x)constructs a JDFShapeRange, both values are equal ("from x to x")JDFShapeRange(JDFShapeRange r)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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)equals - returns true if both JDFShapeRanges are equal otherwise falseJDFShapegetLeft()getLeft - gets the left JDFShape object of the rangeprotected java.lang.ObjectgetLeftObject()java.lang.StringgetLeftString(int precision)JDFShapegetLowerValue()getLowerValue - returns the lower value of the boundsJDFShapegetRight()getRight - gets the right JDFShape object of the rangeprotected java.lang.ObjectgetRightObject()java.lang.StringgetRightString(int precision)JDFShapegetUpperValue()getUpperValue - returns the upper value of the boundsinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractprotected voidinit(JDFShape x, JDFShape y)Initializationprotected booleaninObjectRange(java.lang.Object other)booleaninRange(JDFShape x)inRange - tests if the given x inside of this rangebooleanisPartOfRange(JDFRange ra)isPartOfRange - is range 'r' within this range?booleanisValid(java.lang.String s)isValid - validate the given StringvoidsetLeft(JDFShape x)sets the left JDFShape object of the rangevoidsetRight(JDFShape x)sets the right JDFShape object of the range-
Methods inherited from class org.cip4.jdflib.datatypes.JDFRange
getString, getXJDFString, toString
-
-
-
-
Constructor Detail
-
JDFShapeRange
public JDFShapeRange()
constructs a shape pair range with all values set to 0.0 Double
-
JDFShapeRange
public JDFShapeRange(JDFShape x)
constructs a JDFShapeRange, both values are equal ("from x to x")- Parameters:
x- the given JDFShape
-
JDFShapeRange
public JDFShapeRange(JDFShape xmin, JDFShape xmax)
constructor a JDFShapeRange with two JDFShape values ("from xmin to xmax")- Parameters:
xmin- the given min valuexmax- the given max value
-
JDFShapeRange
public JDFShapeRange(JDFShapeRange r)
copy constructor
constructs a JDFShapeRange with the given JDFShapeRange- Parameters:
r-
-
JDFShapeRange
public JDFShapeRange(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs a JDFShapeRange with the values of the given String- Parameters:
s- the given string representation of the range- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
-
Method Detail
-
getRightString
public java.lang.String getRightString(int precision)
- Overrides:
getRightStringin classJDFRange
-
getLeftString
public java.lang.String getLeftString(int precision)
- Overrides:
getLeftStringin classJDFRange
-
init
protected void init(JDFShape x, JDFShape y)
Initialization- Parameters:
x- left boundaryy- right boundary
-
isValid
public boolean isValid(java.lang.String s)
isValid - validate the given String- Parameters:
s- the given string- Returns:
- boolean - false if the String has not a valid format
-
equals
public boolean equals(java.lang.Object other)
equals - returns true if both JDFShapeRanges are equal otherwise false
-
hashCode
public int hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract
-
inRange
public boolean inRange(JDFShape x)
inRange - tests if the given x inside of this range- Parameters:
x- comparison value- Returns:
- boolean - true if x in range
-
isPartOfRange
public boolean isPartOfRange(JDFRange ra)
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
public JDFShape getLeft()
getLeft - gets the left JDFShape object of the range- Returns:
- JDFShape x - the left JDFShape object of the range
-
getRight
public JDFShape getRight()
getRight - gets the right JDFShape object of the range- Returns:
- JDFShape x - the right JDFShape object of the range
-
setLeft
public void setLeft(JDFShape x)
sets the left JDFShape object of the range- Parameters:
x- the left JDFShape object of the range
-
setRight
public void setRight(JDFShape x)
sets the right JDFShape object of the range- Parameters:
x- the right JDFShape object of the range
-
getUpperValue
public JDFShape getUpperValue()
getUpperValue - returns the upper value of the bounds- Returns:
- JDFShape - the upper value of the range
-
getLowerValue
public JDFShape getLowerValue()
getLowerValue - returns the lower value of the bounds- Returns:
- JDFShape - the lower value of the range
-
getRightObject
protected java.lang.Object getRightObject()
- Specified by:
getRightObjectin classJDFRange
-
getLeftObject
protected java.lang.Object getLeftObject()
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
protected boolean inObjectRange(java.lang.Object other)
- Overrides:
inObjectRangein classJDFRange
-
-