org.cip4.jdflib.datatypes
Class JDFXYPairRangeList

java.lang.Object
  extended by org.cip4.jdflib.datatypes.JDFRangeList
      extended by org.cip4.jdflib.datatypes.JDFXYPairRangeList
All Implemented Interfaces:
JDFBaseDataTypes

public class JDFXYPairRangeList
extends JDFRangeList

This class is a representation of a xy pair range list (JDFXYPairRangeList). It is a whitespace separated list of xy pair ranges, for example "1 2~5 8 10.25 10.25~44.55 55.34"


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
JDFXYPairRangeList()
          constructs an empty range list
JDFXYPairRangeList(JDFXYPairRange r)
          constructs a JDFXYPairRangeList with the given JDFXYPairRange
JDFXYPairRangeList(JDFXYPairRangeList rl)
          copy constructor
constructs a JDFXYPairRangeList with the given JDFXYPairRangeList
JDFXYPairRangeList(String s)
          constructs a JDFXYPairRangeList with values from a given string
 
Method Summary
 void append(JDFXYPair x)
          append - appends a new range to the range list, based on a single JDFXYPair
 void append(JDFXYPair xMin, JDFXYPair xMax)
          append - appends a new range to the range list
 void append(JDFXYPairRange r)
          append - appends a JDFXYPairRange to this number range
static JDFXYPairRangeList createXYPairRangeList(String s)
          factory for JDFXYPairRangeList that silently returns null in case of illegal strings
 boolean inRange(JDFXYPair x)
          inRange - returns true if the given JDFXYPair value is in one of the ranges of this range list
 boolean isOrdered()
          isOrdered - tests if 'this' is OrderedRangeList
 boolean isUniqueOrdered()
          isUniqueOrdered - tests if 'this' is UniqueOrdered RangeList
 boolean isValid(String s)
          isValid - validate the given String
 void setString(String s)
          setString
Parse the string and set the single ranges or pairs and put them into a vector.
 
Methods inherited from class org.cip4.jdflib.datatypes.JDFRangeList
at, begin, clear, elementAt, end, equals, erase, getString, getString, hashCode, isList, isPartOfRange, isPartOfRange, isUnique, remove, size, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDFXYPairRangeList

public JDFXYPairRangeList()
constructs an empty range list


JDFXYPairRangeList

public JDFXYPairRangeList(JDFXYPairRangeList rl)
copy constructor
constructs a JDFXYPairRangeList with the given JDFXYPairRangeList

Parameters:
rl - the JDFXYPairRangeList to copy

JDFXYPairRangeList

public JDFXYPairRangeList(JDFXYPairRange r)
constructs a JDFXYPairRangeList with the given JDFXYPairRange

Parameters:
r - the given JDFXYPairRange

JDFXYPairRangeList

public JDFXYPairRangeList(String s)
                   throws DataFormatException
constructs a JDFXYPairRangeList with values from a given string

Parameters:
s - the given string
Throws:
DataFormatException - - if the String has not a valid format
Method Detail

createXYPairRangeList

public static JDFXYPairRangeList createXYPairRangeList(String s)
factory for JDFXYPairRangeList that silently returns null in case of illegal strings

Parameters:
s - the string to parse
Returns:
the JDFXYPairRangeList, null if s is not compatible

inRange

public boolean inRange(JDFXYPair x)
inRange - returns true if the given JDFXYPair value is in one of the ranges of this range list

Parameters:
x - the given double value to compare
Returns:
boolean - true if in range otherwise false

setString

public void setString(String s)
               throws DataFormatException
setString
Parse the string and set the single ranges or pairs and put them into a vector.
The first and the last positions in the vector are special, because they contain only a half range: the first can start with a pair and the last can end with a pair. The elements in the middle (position 2 - (n-1)) start and end with a half range, but can have pairs in the middle.

For example, if the string looks like this: * "1 2 ~ 4 5 6 7 ~ 8 9 10 11 ~ 1 1"
it is the representation of 3 ranges:
range 1: "1 2 ~ 4 5", range 2: "6 7 ~ 8 9" and range 3: "10 11 ~ 1 1"

Parameters:
s - the given string to cut in seperate xy pair ranges
Throws:
DataFormatException

isValid

public boolean isValid(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(JDFXYPairRange r)
append - appends a JDFXYPairRange to this number range

Parameters:
r - the JDFXYPairRange range to append

append

public void append(JDFXYPair xMin,
                   JDFXYPair xMax)
append - appends a new range to the range list

Parameters:
xMin - the min value of the new range
xMax - the max value of the new range

append

public void append(JDFXYPair x)
append - appends a new range to the range list, based on a single JDFXYPair

Parameters:
x - both the min and the max value of the new range

isOrdered

public boolean isOrdered()
isOrdered - tests if 'this' is OrderedRangeList

Specified by:
isOrdered in class JDFRangeList
Returns:
boolean - true if 'this' is a OrdneredRangeList

isUniqueOrdered

public boolean isUniqueOrdered()
isUniqueOrdered - tests if 'this' is UniqueOrdered RangeList

Specified by:
isUniqueOrdered in class JDFRangeList
Returns:
boolean - true if 'this' is UniqueOrdered RangeList


Copyright © 2013. All Rights Reserved.