org.cip4.jdflib.datatypes
Class JDFRectangleRange

java.lang.Object
  extended by org.cip4.jdflib.datatypes.JDFRange
      extended by org.cip4.jdflib.datatypes.JDFRectangleRange
All Implemented Interfaces:
JDFBaseDataTypes

public class JDFRectangleRange
extends JDFRange


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
JDFRectangleRange()
          constructs a xy pair range with all values set to 0.0 Double
JDFRectangleRange(JDFRectangle x)
          constructs a JDFRectangleRange, both values are equal ("from x to x")
JDFRectangleRange(JDFRectangle xmin, JDFRectangle xmax)
          constructor a JDFRectangleRange with two JDFRectangle values/bounds ("from xmin to xmax")
JDFRectangleRange(JDFRectangleRange r)
          copy constructor - constructs a JDFRectangleRange with the given JDFRectangleRange
JDFRectangleRange(String s)
          Constructs a JDFRectangleRange with the values of the given string
 
Method Summary
 boolean equals(Object other)
          equals - returns true if both JDFRectangleRanges are equal otherwise false
 JDFRectangle getLeft()
          getLeft - gets the left JDFRectangle object of the range
protected  Object getLeftObject()
           
 JDFRectangle getLowerValue()
          getLowerValue - returns the lower value of the bounds
 JDFRectangle getRight()
          getRight - gets the right JDFRectangle object of the range
protected  Object getRightObject()
           
 JDFRectangle getUpperValue()
          getUpperValue - returns the upper value of the bounds
 int hashCode()
          hashCode complements equals() to fulfill the equals/hashCode contract
protected  void init(JDFRectangle x, JDFRectangle y)
          Initialization
protected  boolean inObjectRange(Object other)
           
 boolean inRange(JDFRectangle x)
          inRange - tests if the given x inside of this range
 boolean isPartOfRange(JDFRange ra)
          isPartOfRange - is range 'r' within this range?
 boolean isValid(String s)
          isValid - validate the given String
 void setLeft(JDFRectangle x)
          sets the left JDFRectangle object of the range
 void setRight(JDFRectangle x)
          sets the right JDFRectangle object of the range
 String toString()
          getString - returns the range as a String
 
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

JDFRectangleRange

public JDFRectangleRange()
constructs a xy pair range with all values set to 0.0 Double


JDFRectangleRange

public JDFRectangleRange(JDFRectangle x)
constructs a JDFRectangleRange, both values are equal ("from x to x")

Parameters:
x - - the given JDFRectangle

JDFRectangleRange

public JDFRectangleRange(JDFRectangle xmin,
                         JDFRectangle xmax)
constructor a JDFRectangleRange with two JDFRectangle values/bounds ("from xmin to xmax")

Parameters:
xmin - the given min value
xmax - the given max value

JDFRectangleRange

public JDFRectangleRange(JDFRectangleRange r)
copy constructor - constructs a JDFRectangleRange with the given JDFRectangleRange

Parameters:
r - the JDFRectangleRange to copy

JDFRectangleRange

public JDFRectangleRange(String s)
                  throws DataFormatException
Constructs a JDFRectangleRange with the values of the given string

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

init

protected void init(JDFRectangle x,
                    JDFRectangle y)
Initialization

Parameters:
x - left value
y - right value

toString

public String toString()
getString - returns the range as a String

Overrides:
toString in class Object
Returns:
String - the range as a String

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

equals

public boolean equals(Object other)
equals - returns true if both JDFRectangleRanges are equal otherwise false

Overrides:
equals in class JDFRange
Parameters:
other - the JDFRectangleRange 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

inRange

public boolean inRange(JDFRectangle x)
inRange - tests if the given x inside of this range

Parameters:
x - comparison value
Returns:
boolean - true if x in range

isPartOfRange

public boolean isPartOfRange(JDFRange ra)
isPartOfRange - is range 'r' 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

getLeft

public JDFRectangle getLeft()
getLeft - gets the left JDFRectangle object of the range

Returns:
JDFRectangle - the left JDFRectangle object of the range

getRight

public JDFRectangle getRight()
getRight - gets the right JDFRectangle object of the range

Returns:
JDFRectangle - the right JDFRectangle object of the range

setLeft

public void setLeft(JDFRectangle x)
sets the left JDFRectangle object of the range

Parameters:
x - the left JDFRectangle object of the range

setRight

public void setRight(JDFRectangle x)
sets the right JDFRectangle object of the range

Parameters:
JDFRectangle - x - the right JDFRectangle object of the range

getUpperValue

public JDFRectangle getUpperValue()
getUpperValue - returns the upper value of the bounds

Returns:
JDFRectangle - the upper value of the range

getLowerValue

public JDFRectangle getLowerValue()
getLowerValue - returns the lower value of the bounds

Returns:
JDFRectangle - the lower value of the range

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.