|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Sample
A Sample maintains a grid size in rows and cols, a list of pairs, and a synthetic title, indicating the size and number of spam. Spam is added by the addSpam method. Spam on certain "sacred" squares (such as the initial positions occupied by the DESC) is not allowed and will be ignored.
| Field Summary | |
(package private) OpenList |
blockList
list of pairs indicating coordinates of blockage in this sample |
private int |
cols
the number of columns in the grid for this sample |
private int |
rows
the number of rows in the grid for this sample |
(package private) OpenList |
spamList
list of pairs indicating coordinates of spam in this sample |
| Constructor Summary | |
Sample(int rows,
int cols)
Construct a Sample with a given number of rows and columns |
|
| Method Summary | |
void |
addBlck(int row,
int col)
Add coordinates of a blockage square. |
void |
addSpam(int row,
int col)
Add coordinates of a spam square. |
java.util.Enumeration |
blockEnumeration()
Get an enumeration of the blockList of this Sample. |
int |
getCols()
Get the number of columns of this Sample. |
int |
getRows()
Get the number of rows of this Sample. |
java.lang.String |
getTitle()
Get the synthetic title for this Sample. |
static Sample[] |
makeSamples()
Generate a specific set of Samples. |
protected boolean |
sacred(int row,
int col)
Indicates coordinates of sacred squares, on which spam cannot be placed. |
java.util.Enumeration |
spamEnumeration()
Get an enumeration of the SpamList of this Sample. |
java.lang.String |
toString()
Return a string representation of this Sample, which is defined to be the same as the title. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int rows
private int cols
OpenList spamList
OpenList blockList
| Constructor Detail |
public Sample(int rows,
int cols)
| Method Detail |
protected boolean sacred(int row,
int col)
public void addSpam(int row,
int col)
public void addBlck(int row,
int col)
public java.lang.String getTitle()
public int getRows()
public int getCols()
public java.util.Enumeration spamEnumeration()
public java.util.Enumeration blockEnumeration()
public java.lang.String toString()
toString in class java.lang.Objectpublic static Sample[] makeSamples()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||