Package org.cip4.jdflib.datatypes
Class JDFNameRange
- java.lang.Object
-
- org.cip4.jdflib.datatypes.JDFRange
-
- org.cip4.jdflib.datatypes.JDFNameRange
-
- All Implemented Interfaces:
JDFBaseDataTypes
public class JDFNameRange extends JDFRange
This class represents a name range (JDFNameRange). It is a whitespace separated list of 2 names separated by a tilde "~", for example "jack ~ john"
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue
-
-
Field Summary
-
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 JDFNameRange()constructorJDFNameRange(java.lang.String s)constructs a JDFNameRange with the given stringJDFNameRange(java.lang.String p_left, java.lang.String p_right)constructs a JDFNameRange with two given strings the left and the right nameJDFNameRange(JDFNameRange nr)constructs a JDFNameRange with a give JDFNameRange
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)equals - returns true if both JDFNameRange are equal otherwise falsejava.lang.StringgetLeft()protected java.lang.ObjectgetLeftObject()java.lang.StringgetLowerValue()getLowerValue - returns the lower value of the rangejava.lang.StringgetRight()protected java.lang.ObjectgetRightObject()java.lang.StringgetUpperValue()getUpperValue - return the upper value of the rangeinthashCode()hashCode complements equals() to fulfill the equals/hashCode contractprotected booleaninObjectRange(java.lang.Object other)booleaninRange(java.lang.String x)inRange - returns true if (left string >= x <= right string), it is a lexicographical comparebooleanisPartOfRange(JDFRange ra)isPartOfRange - is range 'ra' within this range?protected voidisValid(java.lang.String s)isValid - validates the given Stringjava.lang.StringtoString()toString-
Methods inherited from class org.cip4.jdflib.datatypes.JDFRange
getLeftString, getRightString, getString, getXJDFString
-
-
-
-
Constructor Detail
-
JDFNameRange
public JDFNameRange()
constructor
-
JDFNameRange
public JDFNameRange(java.lang.String s)
constructs a JDFNameRange with the given string- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
JDFNameRange
public JDFNameRange(java.lang.String p_left, java.lang.String p_right)constructs a JDFNameRange with two given strings the left and the right name- Parameters:
p_left- the given left stringp_right- the given right string
-
JDFNameRange
public JDFNameRange(JDFNameRange nr)
constructs a JDFNameRange with a give JDFNameRange- Parameters:
JDFNameRange- nr
-
-
Method Detail
-
toString
public java.lang.String toString()
toString
-
inRange
public boolean inRange(java.lang.String x)
inRange - returns true if (left string >= x <= right string), it is a lexicographical compare- Parameters:
x- comparison string- Returns:
- boolean - true if x in range otherwise false
-
equals
public boolean equals(java.lang.Object other)
equals - returns true if both JDFNameRange are equal otherwise false
-
hashCode
public int hashCode()
hashCode complements equals() to fulfill the equals/hashCode contract
-
getLowerValue
public java.lang.String getLowerValue()
getLowerValue - returns the lower value of the range- Returns:
- String - the lower value of the range
-
getUpperValue
public java.lang.String getUpperValue()
getUpperValue - return the upper value of the range- Returns:
- String - the upper value of the range
-
isValid
protected void isValid(java.lang.String s)
isValid - validates the given String- Parameters:
s- the given string- Throws:
java.util.zip.DataFormatException- - if the String has not a valid format
-
getLeft
public java.lang.String getLeft()
-
getRight
public java.lang.String getRight()
-
isPartOfRange
public boolean isPartOfRange(JDFRange ra)
Description copied from class:JDFRangeisPartOfRange - is range 'ra' within this range?- Specified by:
isPartOfRangein classJDFRange- Parameters:
ra- the range to test- Returns:
- boolean - true if range 'r' is within this range, else false
-
getRightObject
protected java.lang.Object getRightObject()
- Specified by:
getRightObjectin classJDFRange
-
getLeftObject
protected java.lang.Object getLeftObject()
- Specified by:
getLeftObjectin classJDFRange
-
inObjectRange
protected boolean inObjectRange(java.lang.Object other)
- Overrides:
inObjectRangein classJDFRange
-
-