public class Location
extends java.lang.Object
Locations are immutable.
Modifier and Type | Field and Description |
---|---|
int |
col
the column number, in the range 0..Board.NUM_COLS-1
|
int |
row
the row number, in the range 0..Board.NUM_ROWS-1
|
Constructor and Description |
---|
Location(int row,
int col)
Create a new location.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(int row,
int col)
Returns true if this equals (row,col)
|
boolean |
equals(java.lang.Object other)
Two Locations are equal if they have the same row and column.
|
java.lang.String |
toString() |
public final int row
public final int col
public Location(int row, int col)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public boolean equals(int row, int col)