Package com.iizix.prop
Class GSize
java.lang.Object
com.iizix.prop.GSize
- All Implemented Interfaces:
Serializable,Cloneable
Simple immutable size class for multiple use accepting negative width and height.
- Author:
- Christopher Mindus
- See Also:
Field Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidappend(SendTransaction trans) Appends the size to a transaction.clone()Clones this instance.booleanChecks if two sizes are equal.intgetCX()Gets the width.intgetCY()Gets the height.intGets the height.intgetWidth()Gets the width.inthashCode()Hash code.toString()Formats to a string as "cx,cy".
Field Details
EMPTY_ARRAY
Empty array of Rect's.ZERO
Zero size.
Constructor Details
GSize
public GSize()Constructor for cx=cy=0.GSize
Constructor from a String formatted as "cx,cy".- Parameters:
string- The string.- Throws:
IllegalArgumentException- If the string is not well formatted.
GSize
Constructor from a Transaction.- Parameters:
trans- The transaction.
GSize
public GSize(int cx, int cy) Constructor.- Parameters:
cx- Width.cy- Height.
Method Details
equals
Checks if two sizes are equal. Supports comparison withSize.clone
Clones this instance.hashCode
public int hashCode()Hash code.toString
Formats to a string as "cx,cy".append
Appends the size to a transaction.- Parameters:
trans- Transaction to append to.
getCX
public int getCX()Gets the width.- Returns:
- The width.
getCY
public int getCY()Gets the height.- Returns:
- The height.
getWidth
public int getWidth()Gets the width.- Returns:
- The width.
getHeight
public int getHeight()Gets the height.- Returns:
- The height.