|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object utilities.Position
public class Position
Position.java Created: Fri Nov 22 12:23:16 2002
Field Summary |
---|
Fields inherited from interface utilities.IBoardConstants |
---|
SQUARE_SIZE |
Constructor Summary | |
---|---|
Position(Integer row,
Integer col)
Creates a Position object |
|
Position(Point pt)
Creates a Position object based on a given Point |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Tests to see if the given object has the same row and column values as this position |
Point |
getCenterLocation()
Coverts Position to a Point |
Integer |
getCol()
Returns the column of this position |
Integer |
getRow()
Returns the row of this position |
int |
hashCode()
Generates a hashcode so that two position objects with the same row and column values will have the same hashcode |
Point |
toPoint()
Coverts Position to a Point |
String |
toString()
Returns a string representation of this Position |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Position(Integer row, Integer col)
row
- the index of the row, assumes counting starting at 0col
- the index of the column, assumes counting starting at 0public Position(Point pt)
pt
- a Point to be translated to a row/column positionMethod Detail |
---|
public Integer getRow()
public Integer getCol()
public String toString()
toString
in class Object
Object.toString()
public Point toPoint()
public Point getCenterLocation()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- the object to test for equivalence
Object.equals(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |