Package org.cip4.lib.xjdf.type
Class XYPair
- java.lang.Object
-
- jakarta.xml.bind.annotation.adapters.XmlAdapter<ValueType,BoundType>
-
- org.cip4.lib.xjdf.type.AbstractXJdfType<java.lang.String,XYPair>
-
- org.cip4.lib.xjdf.type.XYPair
-
public class XYPair extends AbstractXJdfType<java.lang.String,XYPair>
XML Attributes of type XYPair are used to describe sizes like Dimensions and StartPosition. They can also be used to describe positions on a page. All numbers that describe lengths are defined in points. XYPair Attributes are primitive data types and are encoded as a string of two numbers, separated by whitespace: "x y"
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XYPairadd(XYPair other)Adds another XYPair the current one.floatgetX()Getter for x attribute.floatgetY()Getter for y attribute.java.lang.Stringmarshal(XYPair xyPair)XYPairsubtract(XYPair other)Subtracts another XYPair from the current one.java.lang.StringtoString()XYPairunmarshal(java.lang.String v)-
Methods inherited from class org.cip4.lib.xjdf.type.AbstractXJdfType
equals, hashCode
-
-
-
-
Constructor Detail
-
XYPair
public XYPair()
Default constructor. Creates an default XYPair object.
-
XYPair
public XYPair(float x, float y)Custom constructor, accepting several values for initializing.
-
XYPair
public XYPair(java.lang.String expression)
Custom Constructor. Creates a new XYPair instance by a String expression.- Parameters:
expression- XYPair as String expression.
-
-
Method Detail
-
getX
public float getX()
Getter for x attribute.- Returns:
- the x
-
getY
public float getY()
Getter for y attribute.- Returns:
- the y
-
add
public XYPair add(XYPair other)
Adds another XYPair the current one.- Parameters:
other- The other one.- Returns:
- The sum of both XYPairs.
-
subtract
public XYPair subtract(XYPair other)
Subtracts another XYPair from the current one.- Parameters:
other- The other one.- Returns:
- The difference of both XYPairs.
-
marshal
public java.lang.String marshal(XYPair xyPair)
- Specified by:
marshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,XYPair>- See Also:
XmlAdapter.marshal(java.lang.Object)
-
unmarshal
public XYPair unmarshal(java.lang.String v)
- Specified by:
unmarshalin classjakarta.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,XYPair>- See Also:
XmlAdapter.unmarshal(java.lang.Object)
-
toString
public java.lang.String toString()
- Specified by:
toStringin classAbstractXJdfType<java.lang.String,XYPair>- See Also:
Object.toString()
-
-