| 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectShipList
public class ShipList
Contains the list of ships present in a board. replicates the vector class
| Constructor Summary | |
|---|---|
ShipList()
 | 
|
| Method Summary | |
|---|---|
 void | 
add(Ship ship)
Adds a ship to this list.  | 
 boolean | 
allShipsSunk()
 | 
 Ship | 
containsShip(int x,
             int y)
Returns the ship present at the requested co-ordinates.  | 
 Ship | 
getShip(int index)
 | 
 int | 
getShipCount()
Returns the number of ships in the list.  | 
 int | 
getShipNumber(Ship ship)
 | 
 void | 
print()
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ShipList()
| Method Detail | 
|---|
public void add(Ship ship)
ship - the instance to be added.
public Ship containsShip(int x,
                         int y)
x - the x co-ordinatey - the y coordinate
public int getShipCount()
public Ship getShip(int index)
public int getShipNumber(Ship ship)
public boolean allShipsSunk()
public void print()
  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||