Package com.iizix
Class Rect
java.lang.Object
com.iizix.Rect
- All Implemented Interfaces:
- Cloneable
Simple rectangle class for multiple use accepting negative width and height.
- Author:
- Christopher Mindus
- Field SummaryFields
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- void- append- (SendTransaction trans) Appends the rectangle to a transaction.- void- clear()Reinitializes the contents.- clone()Clones this instance.- booleanChecks if two rectangles are equal.- int- hashCode()The hash code.- booleanChecks if a position is inside.- toString()Formats to a string as "x,y,cx,cy".
- Field Details- EMPTYEmpty array of Rect's.
- xpublic int xThe X position of the rectangle.
- ypublic int yThe Y position of the rectangle.
- cxpublic int cxThe width of the rectangle.
- cypublic int cyThe height of the rectangle.
 
- Constructor Details- Rectpublic Rect()Constructor for x=y=cx=cy=0.
- RectConstructor from a String formatted as "x,y,cx,cy".- Parameters:
- string- The string.
- Throws:
- IllegalArgumentException- If the string is not well formatted.
 
- RectConstructor from a Transaction.- Parameters:
- trans- The transaction.
 
- Rectpublic Rect- (int x, int y, int cx, int cy) Constructor.- Parameters:
- x- X position.
- y- Y position.
- cx- Width.
- cy- Height.
 
 
- Method Details- isInsideChecks if a position is inside.- Parameters:
- p- The position.
- Returns:
- true if inside, false otherwise.
 
- clearpublic void clear()Reinitializes the contents.
- equalsChecks if two rectangles are equal.
- cloneClones this instance.
- toStringFormats to a string as "x,y,cx,cy".
- hashCodepublic int hashCode()The hash code.
- appendAppends the rectangle to a transaction.- Parameters:
- trans- The transaction to append to.