Package org.cip4.lib.xjdf.type
Class Rectangle
- java.lang.Object
-
- jakarta.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
-
- org.cip4.lib.xjdf.type.AbstractXJdfType<java.lang.String,Rectangle>
-
- org.cip4.lib.xjdf.type.Rectangle
-
public class Rectangle extends AbstractXJdfType<java.lang.String,Rectangle>
XML Attributes of type rectangle are used to describe rectangular locations on the page, Sheet or other printable surface. A rectangle is represented as an array of four numbers — llx lly urx ury — specifying the lower-left x, lowerleft y, upper-right x and upper-right y coordinates of the rectangle, in that order. This is equivalent to the ordering: Left Bottom Right Top. All numbers are defined in points.
-
-
Constructor Summary
Constructors Constructor Description Rectangle()Default constructor.Rectangle(float llx, float lly, float urx, float ury)Custom constructor, accepting values for page coordinates.Rectangle(java.lang.String expression)Custom Constructor.Rectangle(XYPair lowerLeft, XYPair upperRight)Custom constructor, accepting two points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)floatgetHeight()Returns the height of the rectangle.floatgetLlx()Getter for llx attribute.floatgetLly()Getter for lly attribute.XYPairgetLowerLeft()Returns the lower left point as XYPair.XYPairgetSize()Returns the size of the rectangle.XYPairgetUpperRight()Returns the upper right point as XYPair.floatgetUrx()Getter for urx attribute.floatgetUry()Getter for ury attribute.floatgetWidth()Returns the width of the rectangle.inthashCode()java.lang.Stringmarshal(Rectangle v)java.lang.StringtoString()Rectangleunmarshal(java.lang.String v)
-
-
-
Constructor Detail
-
Rectangle
public Rectangle()
Default constructor.
-
Rectangle
public Rectangle(float llx, float lly, float urx, float ury)Custom constructor, accepting values for page coordinates.- Parameters:
llx- Lower-left x.lly- Lower-left y.urx- Upper-right x.ury- Upper-right y.
-
Rectangle
public Rectangle(XYPair lowerLeft, XYPair upperRight)
Custom constructor, accepting two points.- Parameters:
lowerLeft- The lower left coordinatesupperRight- The upper right coordinates
-
Rectangle
public Rectangle(java.lang.String expression)
Custom Constructor. Creates a new Rectangle instance by a String expression.- Parameters:
expression- Rectangle as String expression.
-
-
Method Detail
-
getLlx
public float getLlx()
Getter for llx attribute.- Returns:
- the llx
-
getLly
public float getLly()
Getter for lly attribute.- Returns:
- the lly
-
getUrx
public float getUrx()
Getter for urx attribute.- Returns:
- the urx
-
getUry
public float getUry()
Getter for ury attribute.- Returns:
- the ury
-
getWidth
public float getWidth()
Returns the width of the rectangle.- Returns:
- The rectangles width.
-
getHeight
public float getHeight()
Returns the height of the rectangle.- Returns:
- The rectangles height.
-
getSize
public XYPair getSize()
Returns the size of the rectangle.- Returns:
- The rectangles size.
-
getLowerLeft
public XYPair getLowerLeft()
Returns the lower left point as XYPair.- Returns:
- lower left as XYPair object.
-
getUpperRight
public XYPair getUpperRight()
Returns the upper right point as XYPair.- Returns:
- upper right as XYPair object.
-
marshal
public java.lang.String marshal(Rectangle v)
- Specified by:
marshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Rectangle>- See Also:
javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
-
unmarshal
public Rectangle unmarshal(java.lang.String v)
- Specified by:
unmarshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,Rectangle>- See Also:
javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
-
toString
public java.lang.String toString()
- Specified by:
toStringin classAbstractXJdfType<java.lang.String,Rectangle>- See Also:
Object.toString()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractXJdfType<java.lang.String,Rectangle>- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractXJdfType<java.lang.String,Rectangle>- See Also:
Object.hashCode()
-
-