Package org.cip4.jdflib.datatypes
Class JDFNameRange
java.lang.Object
org.cip4.jdflib.datatypes.JDFRange
org.cip4.jdflib.datatypes.JDFNameRange
- All Implemented Interfaces:
JDFBaseDataTypes
This class represents a name range (JDFNameRange). It is a whitespace separated list of 2 names separated by a tilde
"~", for example "jack ~ john"
-
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
ConstructorsConstructorDescriptionconstructorconstructs a JDFNameRange with the given stringJDFNameRange(String p_left, String p_right) constructs a JDFNameRange with two given strings the left and the right nameconstructs a JDFNameRange with a give JDFNameRange -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals - returns true if both JDFNameRange are equal otherwise falsegetLeft()protected ObjectgetLowerValue - returns the lower value of the rangegetRight()protected ObjectgetUpperValue - return the upper value of the rangeinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractprotected booleaninObjectRange(Object other) booleaninRange - returns true if (left string >= x <= right string), it is a lexicographical comparebooleanisPartOfRange - is range 'ra' within this range?protected voidisValid - validates the given StringtoString()toStringMethods inherited from class org.cip4.jdflib.datatypes.JDFRange
getLeftString, getRightString, getString, getXJDFString
-
Constructor Details
-
JDFNameRange
public JDFNameRange()constructor -
JDFNameRange
constructs a JDFNameRange with the given string- Parameters:
s- the given string- Throws:
DataFormatException- - if the String has not a valid format
-
JDFNameRange
constructs a JDFNameRange with two given strings the left and the right name- Parameters:
p_left- the given left stringp_right- the given right string
-
JDFNameRange
constructs a JDFNameRange with a give JDFNameRange- Parameters:
JDFNameRange- nr
-
-
Method Details
-
toString
toString -
inRange
inRange - returns true if (left string >= x <= right string), it is a lexicographical compare- Parameters:
x- comparison string- Returns:
- boolean - true if x in range otherwise false
-
equals
equals - returns true if both JDFNameRange are equal otherwise false -
hashCode
public int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract -
getLowerValue
getLowerValue - returns the lower value of the range- Returns:
- String - the lower value of the range
-
getUpperValue
getUpperValue - return the upper value of the range- Returns:
- String - the upper value of the range
-
isValid
isValid - validates the given String- Parameters:
s- the given string- Throws:
DataFormatException- - if the String has not a valid format
-
getLeft
-
getRight
-
isPartOfRange
Description copied from class:JDFRangeisPartOfRange - is range 'ra' 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
-
getLeftObject
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
- Overrides:
inObjectRangein classJDFRange
-