org.cip4.jdflib.datatypes
Class JDFNameRange

java.lang.Object
  extended by org.cip4.jdflib.datatypes.JDFRange
      extended by 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
JDFNameRange()
          constructor
JDFNameRange(JDFNameRange nr)
          constructs a JDFNameRange with a give JDFNameRange
JDFNameRange(String s)
          constructs a JDFNameRange with the given string
JDFNameRange(String p_left, String p_right)
          constructs a JDFNameRange with two given strings the left and the right name
 
Method Summary
 boolean equals(Object other)
          equals - returns true if both JDFNameRange are equal otherwise false
 String getLeft()
           
protected  Object getLeftObject()
           
 String getLowerValue()
          getLowerValue - returns the lower value of the range
 String getRight()
           
protected  Object getRightObject()
           
 String getUpperValue()
          getUpperValue - return the upper value of the range
 int hashCode()
          hashCode complements equals() to fulfill the equals/hashCode contract
protected  boolean inObjectRange(Object other)
           
 boolean inRange(String x)
          inRange - returns true if (left string >= x <= right string), it is a lexicographical compare
 boolean isPartOfRange(JDFRange ra)
          isPartOfRange - is range 'ra' within this range?
protected  void isValid(String s)
          isValid - validates the given String
 String toString()
          toString
 
Methods inherited from class org.cip4.jdflib.datatypes.JDFRange
getString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDFNameRange

public JDFNameRange()
constructor


JDFNameRange

public JDFNameRange(String s)
constructs a JDFNameRange with the given string

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

JDFNameRange

public JDFNameRange(String p_left,
                    String p_right)
constructs a JDFNameRange with two given strings the left and the right name

Parameters:
p_left - the given left string
p_right - the given right string

JDFNameRange

public JDFNameRange(JDFNameRange nr)
constructs a JDFNameRange with a give JDFNameRange

Parameters:
JDFNameRange - nr
Method Detail

toString

public String toString()
toString

Overrides:
toString in class Object
Returns:
String

inRange

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

Overrides:
equals in class JDFRange
Parameters:
other - Object to compare
Returns:
boolean - true if equal, otherwise false

hashCode

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

Overrides:
hashCode in class JDFRange
Returns:
int

getLowerValue

public String getLowerValue()
getLowerValue - returns the lower value of the range

Returns:
String - the lower value of the range

getUpperValue

public String getUpperValue()
getUpperValue - return the upper value of the range

Returns:
String - the upper value of the range

isValid

protected void isValid(String s)
isValid - validates the given String

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

getLeft

public String getLeft()

getRight

public String getRight()

isPartOfRange

public boolean isPartOfRange(JDFRange ra)
Description copied from class: JDFRange
isPartOfRange - is range 'ra' within this range?

Specified by:
isPartOfRange in class JDFRange
Parameters:
ra - the range to test
Returns:
boolean - true if range 'r' is within this range, else false

getRightObject

protected Object getRightObject()
Specified by:
getRightObject in class JDFRange

getLeftObject

protected Object getLeftObject()
Specified by:
getLeftObject in class JDFRange

inObjectRange

protected boolean inObjectRange(Object other)
Overrides:
inObjectRange in class JDFRange


Copyright © 2013. All Rights Reserved.