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 Summary
Constructor Summary
Method Summary
Field Details
x
public int xThe X position.y
public int yThe Y position.
Constructor Details
Position
public Position()Constructs a position initialized to 0,0.Position
public Position(int x, int y) Constructs and initializes position.- Parameters:
x
- The X position.y
- The Y position.
Position
Constructs and initializes position.- Parameters:
p
- The position to clone.
Method Details
equals
Check for equality.hashCode
public int hashCode()Hash code.toString
Creates the string representation of this position.compare
Compares 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).