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
public abstract class JDFRangeList extends java.lang.Object implements JDFBaseDataTypes
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
Fields Modifier and Type Field Description protected java.util.ArrayList<JDFRange>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 JDFRangeList()constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JDFRangeat(int i)at(i) - get the i-th range elementJDFRangebegin()begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeListvoidclear()cleanup and empty the internal storgejava.lang.ObjectelementAt(int i)getElementAt - returns the element at the ith positionJDFRangeend()begin() - returns the last JDFDateTimeRange of the JDFDateTimeRangeListbooleanequals(java.lang.Object other)equals - returns true if both JDFNumberRangeList are equal otherwise falsevoiderase(int i)erase(i) - Removes the i-th element of the range listjava.lang.StringgetString()Deprecated.060418 use toStringjava.lang.StringgetString(int precision)toString - serialize to stringinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractbooleanisList()isList - tests if 'this' is a Listabstract booleanisOrdered()booleanisPartOfRange(JDFRange x)isPartOfRange - check whether range 'x' is in the range defined by 'this'booleanisPartOfRange(JDFRangeList x)isPartOfRange - check whether JDFRangeList 'x' is within this range listbooleanisUnique()isUnique - tests if 'this' has only unique valuesabstract booleanisUniqueOrdered()isUniqueOrdered - tests ifthis has only unique values and if the values are orderedvoidremove(int i)remove - removes an object from the vectorintsize()number of Duration range elementsjava.lang.StringtoString()toString - serialize to string
-
-
-
Field Detail
-
rangeList
protected java.util.ArrayList<JDFRange> rangeList
-
-
Method Detail
-
elementAt
public final java.lang.Object elementAt(int i)
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
public final boolean isPartOfRange(JDFRange x)
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
public final boolean isPartOfRange(JDFRangeList x)
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 public final java.lang.String 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
public final java.lang.String toString()
toString - serialize to string- Overrides:
toStringin classjava.lang.Object- Returns:
- String - a list of ranges in the format a ~ b
-
getString
public final java.lang.String getString(int precision)
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
public final JDFRange at(int i)
at(i) - get the i-th range element- Parameters:
i- index of the range to retrieve- Returns:
- JDFRange - JDFDateTimeRange at the position i
-
begin
public final JDFRange begin()
begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeList- Returns:
- JDFRange: the first JDFDateTimeRange of the JDFDateTimeRangeList
-
end
public final JDFRange 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
public final boolean equals(java.lang.Object other)
equals - returns true if both JDFNumberRangeList are equal otherwise false- Overrides:
equalsin classjava.lang.Object- Returns:
- boolean - true if equal otherwise false
-
hashCode
public final int hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract- Overrides:
hashCodein classjava.lang.Object
-
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()
-
-