Package org.cip4.jdflib.datatypes
Class JDFDateTimeRangeList
- java.lang.Object
-
- org.cip4.jdflib.datatypes.JDFRangeList
-
- org.cip4.jdflib.datatypes.JDFDateTimeRangeList
-
- All Implemented Interfaces:
JDFBaseDataTypes
public class JDFDateTimeRangeList extends JDFRangeList
-
-
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 JDFDateTimeRangeList()empty constructorJDFDateTimeRangeList(java.lang.String s)constructs a JDFDateTimeRangeList from a given stringJDFDateTimeRangeList(JDFDateTimeRangeList rl)constructs a JDFDateTimeRangeList from the given JDFDateTimeRangeList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(JDFDateTimeRange r)Add a Duration range r =rMin~rMaxvoidappend(JDFDate x)Add an individual JDFDate elementvoidappend(JDFDate xMin, JDFDate xMax)Add a Duration range defined by two dates xMin~xMaxstatic JDFDateTimeRangeListcreateDateTimeRangeList(java.lang.String s)factory for JDFDateTimeRangeList that silently returns null in case of illegal stringsprotected java.util.ArrayList<JDFDate>getOrderedArray()booleaninRange(JDFDate x)inRange - returns true if the given JDFDate value is in one of the ranges of the range listbooleanisOrdered()isOrdered - tests if 'this' is an OrderedRangeListbooleanisUniqueOrdered()isUniqueOrdered - tests if 'this' is an UniqueOrdered RangeListbooleanisValid(java.lang.String s)isValid - validate the given StringvoidsetString(java.lang.String s)setString - parse the given string and set the duration range list
-
-
-
Constructor Detail
-
JDFDateTimeRangeList
public JDFDateTimeRangeList()
empty constructor
-
JDFDateTimeRangeList
public JDFDateTimeRangeList(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs a JDFDateTimeRangeList from a given string- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFDateTimeRangeList
public JDFDateTimeRangeList(JDFDateTimeRangeList rl)
constructs a JDFDateTimeRangeList from the given JDFDateTimeRangeList- Parameters:
rl- the given JDFDateTimeRangeList
-
-
Method Detail
-
createDateTimeRangeList
public static JDFDateTimeRangeList createDateTimeRangeList(java.lang.String s)
factory for JDFDateTimeRangeList that silently returns null in case of illegal strings- Parameters:
s- the string to parse- Returns:
- the JDFDateTimeRangeList, null if s is not compatible
-
inRange
public boolean inRange(JDFDate x)
inRange - returns true if the given JDFDate value is in one of the ranges of the range list- Parameters:
x- the given JDFDate (duration) 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 duration range list- 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(JDFDateTimeRange r)
Add a Duration range r =rMin~rMax- Parameters:
r- the Duration range to append to the list
-
append
public void append(JDFDate xMin, JDFDate xMax)
Add a Duration range defined by two dates xMin~xMax- Parameters:
xMin- the left value of the Duration range to append to the listxMax- the right value of the Duration range to append to the list
-
append
public void append(JDFDate x)
Add an individual JDFDate element- Parameters:
x- the left and right value of the Duration range to append to the list
-
isOrdered
public boolean isOrdered()
isOrdered - tests if 'this' is an OrderedRangeList- Specified by:
isOrderedin classJDFRangeList- Returns:
- boolean - true if 'this' is an OrdneredRangeList
-
getOrderedArray
protected java.util.ArrayList<JDFDate> getOrderedArray()
-
isUniqueOrdered
public boolean isUniqueOrdered()
isUniqueOrdered - tests if 'this' is an UniqueOrdered RangeList- Specified by:
isUniqueOrderedin classJDFRangeList- Returns:
- boolean - true if 'this' is an UniqueOrdered RangeList
-
-