public class Queen
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
private int |
col |
Holds the column the Queen occupies
|
private int |
row |
Holds the row that the Queen occupies
|
| Constructor | Description |
|---|---|
Queen(int r,
int c) |
Creates a Queen using a row and column
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(java.lang.Object obj) |
Overrides Object's equals method - considers Queens equal
when they have the same
|
int |
getCol() |
Returns the column of this queen
|
int |
getRow() |
Returns the row of this queen
|
java.lang.String |
toString() |
Returns a String representation of this Queen
|
private int row
private int col
Queen(int r,
int c)
r - the int row will be set toc - the int column will be set topublic int getRow()
public int getCol()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the Object this queen is being compared to