Package org.cip4.jdflib.datatypes
Class JDFNameRangeList
- java.lang.Object
-
- org.cip4.jdflib.datatypes.JDFRangeList
-
- org.cip4.jdflib.datatypes.JDFNameRangeList
-
- All Implemented Interfaces:
JDFBaseDataTypes
public class JDFNameRangeList extends JDFRangeList
This class is a representation of a name range list (JDFNameRangeList). It is a whitespace separated list of name ranges, for example "anna~berta hans~otto"
-
-
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
Constructors Constructor Description JDFNameRangeList()constructs an empty JDFNameRangeListJDFNameRangeList(java.lang.String s)constructs a JDFNameRangeList from a given stringJDFNameRangeList(JDFNameRangeList rl)constructs a JDFNameRangeList from the given JDFNameRangeList
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(JDFNameRange r)append - appends a name range to the range liststatic JDFNameRangeListcreateNameRangeList(java.lang.String s)factory for JDFNameRangeList that silently returns null in case of illegal stringsbooleaninRange(java.lang.String x)inRange - returns true if the given string is in range with one of the ranges in the range list (booleanisOrdered()booleanisUniqueOrdered()isUniqueOrdered - tests ifthis has only unique values and if the values are orderedvoidsetString(java.lang.String s)setString - parse the string and separate all single ranges
-
-
-
Constructor Detail
-
JDFNameRangeList
public JDFNameRangeList()
constructs an empty JDFNameRangeList
-
JDFNameRangeList
public JDFNameRangeList(java.lang.String s) throws java.util.zip.DataFormatExceptionconstructs a JDFNameRangeList from a given string- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFNameRangeList
public JDFNameRangeList(JDFNameRangeList rl)
constructs a JDFNameRangeList from the given JDFNameRangeList- Parameters:
rl- the given JDFNameRangeList
-
-
Method Detail
-
createNameRangeList
public static JDFNameRangeList createNameRangeList(java.lang.String s)
factory for JDFNameRangeList that silently returns null in case of illegal strings- Parameters:
s- the string to parse- Returns:
- the JDFNameRangeList, null if s is not compatible
-
setString
public void setString(java.lang.String s) throws java.util.zip.DataFormatExceptionsetString - parse the string and separate all single ranges- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
inRange
public boolean inRange(java.lang.String x)
inRange - returns true if the given string is in range with one of the ranges in the range list (- Parameters:
x- the given string- Returns:
- boolean - true if in range, otherwise false
-
append
public void append(JDFNameRange r)
append - appends a name range to the range list- Parameters:
r- the given name range
-
isUniqueOrdered
public boolean isUniqueOrdered()
Description copied from class:JDFRangeListisUniqueOrdered - tests ifthis has only unique values and if the values are ordered- Specified by:
isUniqueOrderedin classJDFRangeList- Returns:
- true if values are unique and ordered, otherwise false
-
isOrdered
public boolean isOrdered()
- Specified by:
isOrderedin classJDFRangeList
-
-