Package org.cip4.jdflib.datatypes
Class JDFNumberRangeList
- java.lang.Object
-
- org.cip4.jdflib.datatypes.JDFRangeList
-
- org.cip4.jdflib.datatypes.JDFNumberRangeList
-
- All Implemented Interfaces:
JDFBaseDataTypes
public class JDFNumberRangeList extends JDFRangeList
This class is a representation of a number range list (JDFIntegerRangeList). It is a whitespace separated list of number ranges, for example "12.45~15.88 19.0~33.234"
-
-
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
rangeList
-
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 JDFNumberRangeList()constructs an empty JDFNumberRangeListJDFNumberRangeList(java.lang.String s)constructs a JDFNumberRangeList from a given stringJDFNumberRangeList(JDFNumberRange r)constructs a JDFNumberRangeList from the given JDFNumberRangeJDFNumberRangeList(JDFNumberRangeList rl)constructs a JDFNumberRangeList from the given JDFNumberRangeList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(double x)append - appends a new range to the range listvoidappend(double xMin, double xMax)append - appends a new range to the range listvoidappend(JDFNumberRange r)append - appends a JDFNumberRange to this number rangestatic JDFNumberRangeListcreateNumberRangeList(java.lang.String s)factory for JDFNumberRangeList that silently returns null in case of illegal stringsbooleaninRange(double x)inRange - returns true if the given double value is in one of the ranges of the range listbooleanisOrdered()isOrdered - tests if 'this' is OrderedRangeListbooleanisUniqueOrdered()isUniqueOrdered - tests if 'this' is UniqueOrdered RangeListbooleanisValid(java.lang.String s)isValid - validate the given StringvoidsetString(java.lang.String s)setString - parse the given string and set the Number ranges
-
-
-
Constructor Detail
-
JDFNumberRangeList
public JDFNumberRangeList()
constructs an empty JDFNumberRangeList
-
JDFNumberRangeList
public JDFNumberRangeList(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs a JDFNumberRangeList from a given string- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFNumberRangeList
public JDFNumberRangeList(JDFNumberRangeList rl)
constructs a JDFNumberRangeList from the given JDFNumberRangeList- Parameters:
rl- the given JDFNumberRangeList
-
JDFNumberRangeList
public JDFNumberRangeList(JDFNumberRange r)
constructs a JDFNumberRangeList from the given JDFNumberRange- Parameters:
r- the given JDFNumberRange
-
-
Method Detail
-
createNumberRangeList
public static JDFNumberRangeList createNumberRangeList(java.lang.String s)
factory for JDFNumberRangeList that silently returns null in case of illegal strings- Parameters:
s- the string to parse- Returns:
- the JDFNumberRangeList, null if s is not compatible
-
inRange
public boolean inRange(double x)
inRange - returns true if the given double value is in one of the ranges of the range list- Parameters:
x- the given double value to compare- Returns:
- boolean - true if in range otherwise false
-
setString
public void setString(java.lang.String s) throws java.util.zip.DataFormatExceptionsetString - parse the given string and set the Number ranges- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
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
-
append
public void append(JDFNumberRange r)
append - appends a JDFNumberRange to this number range- Parameters:
r- the given number range
-
append
public void append(double xMin, double xMax)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
public void append(double x)
append - appends a new range to the range list- Parameters:
x- 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
-
-