org.cip4.jdflib.datatypes
Class JDFRangeList

java.lang.Object
  extended by 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 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
protected  Vector<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
JDFRangeList()
          constructor
 
Method Summary
 JDFRange at(int i)
          at(i) - get the i-th range element
 JDFRange begin()
          begin() - returns the first JDFDateTimeRange of the JDFDateTimeRangeList
 void clear()
          cleanup and empty the internal storge
 Object elementAt(int i)
          getElementAt - returns the element at the ith position
 JDFRange end()
          begin() - returns the last JDFDateTimeRange of the JDFDateTimeRangeList
 boolean equals(Object other)
          equals - returns true if both JDFNumberRangeList are equal otherwise false
 void erase(int i)
          erase(i) - Removes the i-th element of the range list
 String getString()
          Deprecated. 060418 use toString
 String getString(int precision)
          toString - serialize to string
 int hashCode()
          hashCode complements equals() to fulfill the equals/hashCode contract
 boolean isList()
          isList - tests if 'this' is a List
abstract  boolean isOrdered()
           
 boolean isPartOfRange(JDFRange x)
          isPartOfRange - check whether range 'x' is in the range defined by 'this'
 boolean isPartOfRange(JDFRangeList x)
          isPartOfRange - check whether JDFRangeList 'x' is within this range list
 boolean isUnique()
          isUnique - tests if 'this' has only unique values
abstract  boolean isUniqueOrdered()
          isUniqueOrdered - tests if this has only unique values and if the values are ordered
 void remove(int i)
          remove - removes an object from the vector
 int size()
          number of Duration range elements
 String toString()
          toString - serialize to string
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rangeList

protected Vector<JDFRange> rangeList
Constructor Detail

JDFRangeList

public JDFRangeList()
constructor

Method Detail

elementAt

public final 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 String getString()
Deprecated. 060418 use toString

getString - serialize to string

Returns:
String - a list of ranges in the format PT30M30S~PT35M (duration (JDFDate) has a format=P1Y2M3DT12H30M30S)

toString

public final String toString()
toString - serialize to string

Overrides:
toString in class Object
Returns:
String - a list of ranges in the format a ~ b

getString

public final 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(Object other)
equals - returns true if both JDFNumberRangeList are equal otherwise false

Overrides:
equals in class Object
Returns:
boolean - true if equal otherwise false

hashCode

public final int hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract

Overrides:
hashCode in class Object

isUniqueOrdered

public abstract boolean isUniqueOrdered()
isUniqueOrdered - tests if this 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()


Copyright © 2013. All Rights Reserved.