Package org.cip4.jdflib.datatypes
Class JDFRangeList
java.lang.Object
org.cip4.jdflib.datatypes.JDFRangeList
- All Implemented Interfaces:
JDFBaseDataTypes
- Direct Known Subclasses:
JDFDateTimeRangeList,JDFDurationRangeList,JDFIntegerRangeList,JDFNameRangeList,JDFNumberRangeList,JDFRectangleRangeList,JDFShapeRangeList,JDFXYPairRangeList
This abstract class is the representation of a range list. Intern these object are collected in a vector and there are several methods to provide an access to the data. A range has the following
format : "1~3.4" The class member Vector rangeList contains for example "1~3.4" , "7~5"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue -
Field Summary
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionfinal JDFRangeat(int i) at(i) - get the i-th range elementfinal JDFRangebegin()begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeListfinal voidclear()cleanup and empty the internal storgefinal ObjectelementAt(int i) getElementAt - returns the element at the ith positionfinal JDFRangeend()begin() - returns the last JDFDateTimeRange of the JDFDateTimeRangeListfinal booleanequals - returns true if both JDFNumberRangeList are equal otherwise falsefinal voiderase(int i) erase(i) - Removes the i-th element of the range listfinal StringDeprecated.060418 use toStringfinal StringgetString(int precision) toString - serialize to stringfinal inthashCode()hashCode complements equals() to fulfill the equals/hashCode contractfinal booleanisList()isList - tests if 'this' is a Listabstract booleanfinal booleanisPartOfRange - check whether range 'x' is in the range defined by 'this'final booleanisPartOfRange - check whether JDFRangeList 'x' is within this range listfinal booleanisUnique()isUnique - tests if 'this' has only unique valuesabstract booleanisUniqueOrdered - tests ifthis has only unique values and if the values are orderedfinal voidremove(int i) remove - removes an object from the vectorfinal intsize()number of Duration range elementsfinal StringtoString()toString - serialize to string
-
Field Details
-
rangeList
-
-
Constructor Details
-
JDFRangeList
public JDFRangeList()constructor
-
-
Method Details
-
elementAt
getElementAt - returns the element at the ith position- Parameters:
i- the position of the element to be retrieved- Returns:
- Object - the range object at the given position
-
remove
public final void remove(int i) remove - removes an object from the vector- Parameters:
i- the index of the element to remove
-
isPartOfRange
isPartOfRange - check whether range 'x' is in the range defined by 'this'- Parameters:
x- JDFRange to test- Returns:
- boolean - true if 'x' is in the range defined by 'this'
-
isPartOfRange
isPartOfRange - check whether JDFRangeList 'x' is within this range list- Parameters:
x- the range list to test- Returns:
- boolean - true if range list 'x' is within 'this' range list, else false
-
getString
Deprecated.060418 use toStringgetString - serialize to string- Returns:
- String - a list of ranges in the format PT30M30S~PT35M (duration (JDFDate) has a format=P1Y2M3DT12H30M30S)
-
toString
toString - serialize to string -
getString
toString - serialize to string- Returns:
- String - a list of ranges in the format a ~ b
-
size
public final int size()number of Duration range elements- Returns:
- int - the number of Duration ranges in the list
-
clear
public final void clear()cleanup and empty the internal storge -
at
at(i) - get the i-th range element- Parameters:
i- index of the range to retrieve- Returns:
- JDFRange - JDFDateTimeRange at the position i
-
begin
begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeList- Returns:
- JDFRange: the first JDFDateTimeRange of the JDFDateTimeRangeList
-
end
begin() - returns the last JDFDateTimeRange of the JDFDateTimeRangeList- Returns:
- JDFRange: the last JDFDateTimeRange of the JDFDateTimeRangeList
-
erase
public final void erase(int i) erase(i) - Removes the i-th element of the range list- Parameters:
i- index of element (range) to remove
-
isList
public final boolean isList()isList - tests if 'this' is a List- Returns:
- boolean - true if 'this' contains no ranges
-
equals
equals - returns true if both JDFNumberRangeList are equal otherwise false -
hashCode
public final int hashCode()hashCode complements equals() to fulfill the equals/hashCode contract -
isUniqueOrdered
public abstract boolean isUniqueOrdered()isUniqueOrdered - tests ifthis has only unique values and if the values are ordered- Returns:
- true if values are unique and ordered, otherwise false
-
isUnique
public final boolean isUnique()isUnique - tests if 'this' has only unique values- Returns:
- boolean: true if 'this' is a unique range list
-
isOrdered
public abstract boolean isOrdered()
-