public class Position
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected int |
x
The x position.
|
protected int |
y
The y position.
|
| Constructor and Description |
|---|
Position()
Create a position.
|
Position(int x,
int y)
Create a position.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Clone the object.
|
boolean |
equals(java.lang.Object o)
Test if two positions are equal.
|
static Position |
fromString(java.lang.String spos)
Convert a position string back to a position object.
|
java.lang.String |
getPrintableX()
Get the string representation for x.
|
java.lang.String |
getPrintableY()
Get the string representation for y.
|
int |
getX()
Get the x value.
|
int |
getY()
Get the y value.
|
int |
hashCode()
Calculate the hash code.
|
void |
setX(int x)
Set x.
|
void |
setY(int y)
Set y.
|
java.lang.String |
toString()
Get the string representation.
|
public Position()
public Position(int x,
int y)
public int getX()
public int getY()
public void setX(int x)
x - public void setY(int y)
y - public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getPrintableX()
public java.lang.String getPrintableY()
public java.lang.Object clone()
clone in class java.lang.Objectpublic static Position fromString(java.lang.String spos)
spos - The position as string.