Package org.cip4.jdflib.datatypes
Class JDFDateTimeRange
java.lang.Object
org.cip4.jdflib.datatypes.JDFRange
org.cip4.jdflib.datatypes.JDFDateTimeRange
- All Implemented Interfaces:
JDFBaseDataTypes
-
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
ConstructorsConstructorDescriptionEmpty range constructorConstruct a JDFDateTimeRange from a stringcopy constructorConstructor - creates a DateTime range defined by x ("from x to x")JDFDateTimeRange(JDFDate xmin, JDFDate xmax) Constructor - creates a DateTime range defined by xmin and xmax -
Method Summary
Modifier and TypeMethodDescriptionstatic JDFDateTimeRangecreateDateTimeRange(String date) factory style constructor that catches all exceptions and returns null if date is invalidgetLeft()getLeft - get the left of the two range deliminators xmin ~ xmaxprotected JDFDategetLeftString(int precision) getLowerValue - returns the lower value of the boundsgetRight()getRight - get the right of the two range deliminators xmin ~ xmaxprotected JDFDategetRightString(int precision) getUpperValue - returns the upper value of the boundsgetXJDFString(int precision) toStringprotected voidInitializationprotected booleaninObjectRange(Object other) booleaninRange - returns true if 'x' is within the range defined by 'this'booleanisPartOfRange - is range 'r' within this range?booleanisValid - validate the given StringvoidsetLeft - sets the left JDFDate object of the rangevoidsetRight - sets the right JDFDate object of the rangetoString()toString
-
Constructor Details
-
JDFDateTimeRange
public JDFDateTimeRange()Empty range constructor -
JDFDateTimeRange
Constructor - creates a DateTime range defined by x ("from x to x")- Parameters:
x- boundary of the date/time range
-
JDFDateTimeRange
Constructor - creates a DateTime range defined by xmin and xmax- Parameters:
xmin-xmax-
-
JDFDateTimeRange
copy constructor- Parameters:
r-
-
JDFDateTimeRange
Construct a JDFDateTimeRange from a string- Parameters:
s-- Throws:
DataFormatException- - if the String has not a valid format
-
-
Method Details
-
init
Initialization- Parameters:
xmin-xmax-
-
createDateTimeRange
factory style constructor that catches all exceptions and returns null if date is invalid- Parameters:
date- the formatted date string- Returns:
- the JDFDate , null if date is not a valid string
-
toString
toString -
getXJDFString
toString- Overrides:
getXJDFStringin classJDFRange- Returns:
- String
-
isValid
isValid - validate the given String- Parameters:
s- the given string- Returns:
- boolean - false if the String has not a valid format
-
inRange
inRange - returns true if 'x' is within the range defined by 'this'- Parameters:
x- JDFDate that is to be compared with 'this'- Returns:
- boolean - true if 'x' is within the range defined by 'this'
-
isPartOfRange
isPartOfRange - is range 'r' 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
-
getLeft
getLeft - get the left of the two range deliminators xmin ~ xmax- Returns:
- JDFDate - the left value
-
getRight
getRight - get the right of the two range deliminators xmin ~ xmax- Returns:
- JDFDate - the right value
-
setLeft
setLeft - sets the left JDFDate object of the range- Parameters:
x- the left JDFDate object of the range
-
setRight
setRight - sets the right JDFDate object of the range- Parameters:
x- the right JDFDate object of the range
-
getUpperValue
getUpperValue - returns the upper value of the bounds- Returns:
- JDFDate - the upper value of the range
-
getLowerValue
getLowerValue - returns the lower value of the bounds- Returns:
- JDFDate - the lower value of the range
-
getRightObject
- Specified by:
getRightObjectin classJDFRange
-
getLeftObject
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
- Overrides:
inObjectRangein classJDFRange
-
getRightString
- Overrides:
getRightStringin classJDFRange
-
getLeftString
- Overrides:
getLeftStringin classJDFRange
-