|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectCSE115.Pacman.Position
public class Position
A class that represents a row, column pair. Particularly useful for game board that need to be displayed graphically.
Created: Fri Nov 22 12:23:16 2002
| Field Summary |
|---|
| Fields inherited from interface CSE115.Pacman.Constants |
|---|
CELL_SIZE |
| Constructor Summary | |
|---|---|
Position(int row,
int col)
Creates a Position instance given the row and column |
|
Position(Point pt)
Creates a Position instance given a point. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Point |
getCenterLocation()
Gives the center of the row/column space (assumes they are rectangular positions). |
int |
getCol()
Returns the column of the position |
int |
getRow()
Returns the row of the position |
int |
hashCode()
|
Point |
toPoint()
Converts the row/column position into a java.awt.Point |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Position(int row,
int col)
row - the row for the Positioncol - the column for the Positionpublic Position(Point pt)
pt - the point to be converted| Method Detail |
|---|
public int getRow()
public int getCol()
public Point getCenterLocation()
public String toString()
toString in class Objectpublic Point toPoint()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||