Package jadex.web.examples.puzzle
Class Position
- java.lang.Object
- 
- jadex.web.examples.puzzle.Position
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 
 public class Position extends java.lang.Object implements java.io.Serializable, java.lang.CloneableA position has two coordinates.- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Clone the object.booleanequals(java.lang.Object o)Test if two positions are equal.static PositionfromString(java.lang.String spos)Convert a position string back to a position object.java.lang.StringgetPrintableX()Get the string representation for x.java.lang.StringgetPrintableY()Get the string representation for y.intgetX()Get the x value.intgetY()Get the y value.inthashCode()Calculate the hash code.voidsetX(int x)Set x.voidsetY(int y)Set y.java.lang.StringtoString()Get the string representation.
 
- 
- 
- 
Method Detail- 
getXpublic int getX() Get the x value.
 - 
getYpublic int getY() Get the y value.
 - 
setXpublic void setX(int x) Set x.- Parameters:
- x-
 
 - 
setYpublic void setY(int y) Set y.- Parameters:
- y-
 
 - 
equalspublic boolean equals(java.lang.Object o) Test if two positions are equal.- Overrides:
- equalsin class- java.lang.Object
- Returns:
- True, if equal.
 
 - 
hashCodepublic int hashCode() Calculate the hash code.- Overrides:
- hashCodein class- java.lang.Object
- Returns:
- The hash code.
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 - 
getPrintableXpublic java.lang.String getPrintableX() Get the string representation for x.- Returns:
- The string representation for y.
 
 - 
getPrintableYpublic java.lang.String getPrintableY() Get the string representation for y.- Returns:
- The string representation for y.
 
 - 
clonepublic java.lang.Object clone() Clone the object.- Overrides:
- clonein class- java.lang.Object
- Returns:
- The clone.
 
 - 
fromStringpublic static Position fromString(java.lang.String spos) Convert a position string back to a position object. It can covert either "x y" and also the printable notation "[A..X] [1..X]".- Parameters:
- spos- The position as string.
- Returns:
- The position object.
 
 
- 
 
-