cmsc433.p3
Class Position
java.lang.Object
cmsc433.p3.Position
@Immutable
public class Position
- extends java.lang.Object
Stores a position in the maze.
|
Field Summary |
int |
col
The column for this position |
int |
row
The row for this position |
|
Constructor Summary |
Position(int col,
int row)
|
|
Method Summary |
boolean |
equals(java.lang.Object other)
|
int |
hashCode()
|
Position |
move(Direction dir)
Generates a new position that is the result of moving from this position
in direction "dir." |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
col
public final int col
- The column for this position
row
public final int row
- The row for this position
Position
public Position(int col,
int row)
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
move
public Position move(Direction dir)
- Generates a new position that is the result of moving from this position
in direction "dir."
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object