Package com.iizix
Class Position
- java.lang.Object
- com.iizix.Position
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class Position extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
A position with integers.- Author:
- Christopher Mindus
- See Also:
- Serialized Form
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
compare(Position p1, Position p2)
Compares to position by first X, then Y.boolean
equals(java.lang.Object o)
Check for equality.int
hashCode()
Hash code.java.lang.String
toString()
Creates the string representation of this position.
Constructor Detail
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
public Position(Position p)
Constructs and initializes position.- Parameters:
p
- The position to clone.
Method Detail
equals
public boolean equals(java.lang.Object o)
Check for equality.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- Another object.- Returns:
- true if it's the same Position object values, false otherwise.
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- Returns the hash code.
toString
public java.lang.String toString()
Creates the string representation of this position.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Position String as "className[x=NN,y=NN]".