Package com.iizix
Class Position
java.lang.Object
com.iizix.Position
- All Implemented Interfaces:
- Serializable,- Cloneable
A position with integers.
- Author:
- Christopher Mindus
- See Also:
- Field SummaryFields
- Constructor SummaryConstructors
- Method Summary
- Field Details- xpublic int xThe X position.
- ypublic int yThe Y position.
 
- Constructor Details- Positionpublic Position()Constructs a position initialized to 0,0.
- Positionpublic Position- (int x, int y) Constructs and initializes position.- Parameters:
- x- The X position.
- y- The Y position.
 
- PositionConstructs and initializes position.- Parameters:
- p- The position to clone.
 
 
- Method Details- equalsCheck for equality.
- hashCodepublic int hashCode()Hash code.
- toStringCreates the string representation of this position.
- compareCompares to position by first X, then Y.- Parameters:
- p1- Position 1 (null allowed).
- p2- Position 2 (null allowed).
- Returns:
- 1 if p1 is "larger" than p2 (or p2 is null), -1 if "smaller" (or p2 is null), 0 if equal (both null).