org.cip4.jdflib.datatypes
Class JDFRectangle

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Object>
              extended by org.cip4.jdflib.datatypes.JDFNumList
                  extended by org.cip4.jdflib.datatypes.JDFRectangle
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Object>, Collection<Object>, List<Object>, RandomAccess, JDFBaseDataTypes

public class JDFRectangle
extends JDFNumList

This class represents a rectangle JDFRectangle) consisting of a lower left x value (llx), a lower left y value (lly), an upper right x value (urx) and an upper right y value (ury) all values are Double types.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.cip4.jdflib.datatypes.JDFBaseDataTypes
JDFBaseDataTypes.EnumFitsValue
 
Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
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
JDFRectangle()
          constructs a rectangle with all 4 values set to 0.0 Double
JDFRectangle(double llx, double lly, double urx, double ury)
          constructs a new JDFRectangle with the given double values
JDFRectangle(JDFNumList nl)
          constructs a rectangle with all values set via a JDFNumberList
JDFRectangle(JDFRectangle rec)
          constructs a rectangle with all values set via a JDFRectangle
JDFRectangle(String s)
          constructs a rectangle with all values set via a String
JDFRectangle(Vector v)
          Deprecated. use typesafe constructors
 
Method Summary
static JDFRectangle createRectangle(String s)
          factory for JDFRectangle that silently returns null in case of illegal strings
 double getHeight()
          getHeight - returns the height of the rectangle, the difference between upper right y value and lower left y value as an absolute value
 double getLlx()
          getLlx - returns the lower left x coordinate
 double getLly()
          getLly - returns the lower left y coordinate
 double getUrx()
          getUrx - returns the upper right x coordinate
 double getUry()
          getUry - returns the upper right y coordinate
 double getWidth()
          getWidth - returns the width of the rectangle, the difference between upper right x value and lower left x value as an absolute value
 boolean isGreater(JDFRectangle r)
          isGreater - equality operator >
 boolean isGreaterOrEqual(JDFRectangle r)
          isGreaterOrEqual - equality operator >=
 boolean isLess(JDFRectangle r)
          isLess - equality operator <
 boolean isLessOrEqual(JDFRectangle r)
          isLessOrEqual - equality operator <=
 boolean isValid()
          isValid - true if the size of the vector is 4 and all instances are Double types
 void setLlx(double x)
          setLlx - sets the lower left x coordinate
 void setLlxMm(double mmX)
          setLlXMm - sets the lower left x coordinate in millimeter
 void setLly(double y)
          setLly - sets the lower left y coordinate
 void setLlyMm(double mmY)
          setLlyMm - sets the lower left y coordinate in millimeter
 void setUrx(double x)
          setUrx - sets the upper right x coordinate
 void setUrxMm(double mmX)
          setUrxMm - sets the upper right x coordinate in millimeter
 void setUry(double y)
          setUry - sets the upper right y coordinate
 void setUryMm(double mmY)
          setUryMm - sets the upper right y coordinate in millimeter
 
Methods inherited from class org.cip4.jdflib.datatypes.JDFNumList
abs, clone, contains, containsAll, copyNumList, doubleAt, elementAt, equals, getDoubleList, getIntArray, getString, getString, hashCode, isValidString, matches, removeElementAt, replaceElementAt, scale, scaleFromCM, scaleFromMM, scaleToCM, scaleToMM, set, setString, subtract, toString, unify
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

JDFRectangle

public JDFRectangle()
constructs a rectangle with all 4 values set to 0.0 Double


JDFRectangle

@Deprecated
public JDFRectangle(Vector v)
             throws DataFormatException
Deprecated. use typesafe constructors

constructs a rectangle with all values set via a Vector of Double objects

Parameters:
v - the given Vector with MAX_RECTANGLE_DIMENSION objects of type Double
Throws:
DataFormatException - - if the Vector has not a valid format

JDFRectangle

public JDFRectangle(String s)
             throws DataFormatException
constructs a rectangle with all values set via a String

Parameters:
s - the given String, blank separated numbers
Throws:
DataFormatException - - if the String has not a valid format

JDFRectangle

public JDFRectangle(JDFRectangle rec)
constructs a rectangle with all values set via a JDFRectangle

Parameters:
rec - the given rectangle

JDFRectangle

public JDFRectangle(JDFNumList nl)
             throws DataFormatException
constructs a rectangle with all values set via a JDFNumberList

Parameters:
nl - the given number list
Throws:
DataFormatException - - if the JDFNumberList has not a valid format

JDFRectangle

public JDFRectangle(double llx,
                    double lly,
                    double urx,
                    double ury)
constructs a new JDFRectangle with the given double values

Parameters:
llx - lower left x coordinate
lly - lower left y coordinate
urx - lower left x coordinate
ury - lower left y coordinate
Method Detail

createRectangle

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

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

isValid

public boolean isValid()
                throws DataFormatException
isValid - true if the size of the vector is 4 and all instances are Double types

Specified by:
isValid in class JDFNumList
Returns:
boolean - true if all instances are Double or Integer types
Throws:
DataFormatException - - if the Vector has not a valid format

getLlx

public double getLlx()
getLlx - returns the lower left x coordinate

Returns:
double - the lower left x coordinate

setLlx

public void setLlx(double x)
setLlx - sets the lower left x coordinate

Parameters:
x - the lower left x coordinate

setLlxMm

public void setLlxMm(double mmX)
setLlXMm - sets the lower left x coordinate in millimeter

Parameters:
mmX - the lower left x coordinate in millimeter

getLly

public double getLly()
getLly - returns the lower left y coordinate

Returns:
double - the lower left y coordinate

setLly

public void setLly(double y)
setLly - sets the lower left y coordinate

Parameters:
y - the lower left y coordinate

setLlyMm

public void setLlyMm(double mmY)
setLlyMm - sets the lower left y coordinate in millimeter

Parameters:
mmY - the lower left y coordinate in millimeter

getUrx

public double getUrx()
getUrx - returns the upper right x coordinate

Returns:
double - the upper right x coordinate

setUrx

public void setUrx(double x)
setUrx - sets the upper right x coordinate

Parameters:
x - the upper right x coordinate

setUrxMm

public void setUrxMm(double mmX)
setUrxMm - sets the upper right x coordinate in millimeter

Parameters:
mmX - the upper right x coordinate in millimeter

getUry

public double getUry()
getUry - returns the upper right y coordinate

Returns:
double - the upper right y coordinate

setUry

public void setUry(double y)
setUry - sets the upper right y coordinate

Parameters:
y - the upper right y coordinate

setUryMm

public void setUryMm(double mmY)
setUryMm - sets the upper right y coordinate in millimeter

Parameters:
mmY - the upper right y coordinate in millimeter

getWidth

public double getWidth()
getWidth - returns the width of the rectangle, the difference between upper right x value and lower left x value as an absolute value

Returns:
double - the width of the rectangle

getHeight

public double getHeight()
getHeight - returns the height of the rectangle, the difference between upper right y value and lower left y value as an absolute value

Returns:
double - the height of the rectangle

isGreater

public boolean isGreater(JDFRectangle r)
isGreater - equality operator >

Parameters:
r - the JDFRectangle object to compare to
Returns:
boolean - true if this > r

isGreaterOrEqual

public boolean isGreaterOrEqual(JDFRectangle r)
isGreaterOrEqual - equality operator >=

Parameters:
r - the JDFRectangle object to compare to
Returns:
boolean - true if this >= r

isLess

public boolean isLess(JDFRectangle r)
isLess - equality operator <

Parameters:
r - the JDFRectangle object to compare to
Returns:
boolean - true if this < r

isLessOrEqual

public boolean isLessOrEqual(JDFRectangle r)
isLessOrEqual - equality operator <=

Parameters:
r - the JDFRectangle object to compare to
Returns:
boolean - true if this <= r


Copyright © 2013. All Rights Reserved.