|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OceanInterface
OceanInterface - Interface for simulating and manipulating an Ocean - get/set for bounds of Ocean - get/set for linkedList of OceanObjects - append/remove for linkedList of OceanObjects - compute the next item at a specific position - method for a readable output of Ocean and OceanObjects
Method Summary | |
---|---|
void |
addOceanObject(OceanObject oceanObject)
Appends an oceanObject to the list |
int |
getDepth()
Returns depth of ocean in pixels |
java.util.LinkedList<OceanObject> |
getOceanObjects()
Returns a linked list of all OceanObjects |
int |
getWidth()
Returns depth of ocean in pixels |
int |
indexOfNearestObject(int[] position)
Compute the next item to a specific position |
OceanInterface |
loadOcean(java.lang.String filename)
Reads and deserialize an objectStream from file |
void |
removeOceanObject(int index)
Removes an oceanObject at a specific position (index) |
void |
saveOcean(java.lang.String filename)
Serialize and write all oceanObjects to a file |
void |
setDepth(int depth)
Set the depth of ocean |
void |
setOceanObjects(java.util.LinkedList<OceanObject> oceanObjects)
Sets a list of OceanObjects |
void |
setWidth(int width)
Set the width of ocean |
java.lang.String |
toString()
Returns a readable output |
Method Detail |
---|
int getWidth()
void setWidth(int width) throws OceanException
width
-
OceanException
- - if width is invalidint getDepth()
void setDepth(int depth) throws OceanException
depth
-
OceanException
- - if depth is invalidjava.util.LinkedList<OceanObject> getOceanObjects()
void setOceanObjects(java.util.LinkedList<OceanObject> oceanObjects)
oceanObjects
- void addOceanObject(OceanObject oceanObject) throws OceanException
oceanObject
-
OceanException
- - if data of oceanObject is invalid (i.e. position)void removeOceanObject(int index) throws java.lang.IllegalArgumentException
index
-
OceanException
- - if index is invalid (i.e. out of bounds)
java.lang.IllegalArgumentException
int indexOfNearestObject(int[] position) throws OceanException
position
-
OceanException
void saveOcean(java.lang.String filename) throws java.io.IOException
filename
-
java.io.IOException
OceanInterface loadOcean(java.lang.String filename) throws java.lang.ClassNotFoundException, java.io.IOException
filename
-
java.lang.ClassNotFoundException
java.io.IOException
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |