Package org.cip4.jdflib.datatypes
Class JDFXYPairRangeList
java.lang.Object
org.cip4.jdflib.datatypes.JDFRangeList
org.cip4.jdflib.datatypes.JDFXYPairRangeList
- All Implemented Interfaces:
JDFBaseDataTypes
This class is a representation of a xy pair range list (JDFXYPairRangeList). It is a whitespace separated list of xy pair ranges, for example "1 2~5 8 10.25 10.25~44.55 55.34"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue -
Field Summary
Fields inherited from class org.cip4.jdflib.datatypes.JDFRangeList
rangeListFields 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 an empty range listconstructs a JDFXYPairRangeList with values from a given stringconstructs a JDFXYPairRangeList with the given JDFXYPairRangecopy constructor
constructs a JDFXYPairRangeList with the given JDFXYPairRangeList -
Method Summary
Modifier and TypeMethodDescriptionvoidappend - appends a new range to the range list, based on a single JDFXYPairvoidappend - appends a JDFXYPairRange to this number rangevoidappend - appends a new range to the range liststatic JDFXYPairRangeListfactory for JDFXYPairRangeList that silently returns null in case of illegal stringsbooleaninRange - returns true if the given JDFXYPair value is in one of the ranges of this range listbooleanisOrdered - tests if 'this' is OrderedRangeListbooleanisUniqueOrdered - tests if 'this' is UniqueOrdered RangeListbooleanisValid - validate the given StringvoidsetString
Parse the string and set the single ranges or pairs and put them into a vector.
The first and the last positions in the vector are special, because they contain only a half range: the first can start with a pair and the last can end with a pair.
-
Constructor Details
-
JDFXYPairRangeList
public JDFXYPairRangeList()constructs an empty range list -
JDFXYPairRangeList
copy constructor
constructs a JDFXYPairRangeList with the given JDFXYPairRangeList- Parameters:
rl- the JDFXYPairRangeList to copy
-
JDFXYPairRangeList
constructs a JDFXYPairRangeList with the given JDFXYPairRange- Parameters:
r- the given JDFXYPairRange
-
JDFXYPairRangeList
constructs a JDFXYPairRangeList with values from a given string- Parameters:
s- the given string- Throws:
DataFormatException- - if the String has not a valid format
-
-
Method Details
-
createXYPairRangeList
factory for JDFXYPairRangeList that silently returns null in case of illegal strings- Parameters:
s- the string to parse- Returns:
- the JDFXYPairRangeList, null if s is not compatible
-
inRange
inRange - returns true if the given JDFXYPair value is in one of the ranges of this range list- Parameters:
x- the given double value to compare- Returns:
- boolean - true if in range otherwise false
-
setString
setString
Parse the string and set the single ranges or pairs and put them into a vector.
The first and the last positions in the vector are special, because they contain only a half range: the first can start with a pair and the last can end with a pair. The elements in the middle (position 2 - (n-1)) start and end with a half range, but can have pairs in the middle.For example, if the string looks like this: * "1 2 ~ 4 5 6 7 ~ 8 9 10 11 ~ 1 1"
it is the representation of 3 ranges:
range 1: "1 2 ~ 4 5", range 2: "6 7 ~ 8 9" and range 3: "10 11 ~ 1 1"- Parameters:
s- the given string to cut in seperate xy pair ranges- Throws:
DataFormatException
-
isValid
isValid - validate the given String- Parameters:
s- the given string- Returns:
- boolean - false if the String has not a valid format
-
append
append - appends a JDFXYPairRange to this number range- Parameters:
r- the JDFXYPairRange range to append
-
append
append - appends a new range to the range list- Parameters:
xMin- the min value of the new rangexMax- the max value of the new range
-
append
append - appends a new range to the range list, based on a single JDFXYPair- Parameters:
x- both the min and the max value of the new range
-
isOrdered
public boolean isOrdered()isOrdered - tests if 'this' is OrderedRangeList- Specified by:
isOrderedin classJDFRangeList- Returns:
- boolean - true if 'this' is a OrdneredRangeList
-
isUniqueOrdered
public boolean isUniqueOrdered()isUniqueOrdered - tests if 'this' is UniqueOrdered RangeList- Specified by:
isUniqueOrderedin classJDFRangeList- Returns:
- boolean - true if 'this' is UniqueOrdered RangeList
-