public class MovementThread
extends java.lang.Thread
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.lang.Integer |
lock
The lock object.
|
private Ocean |
myOcean
The ocean.
|
private static long |
serialVersionUID
The Constant serialVersionUID.
|
Constructor and Description |
---|
MovementThread(Ocean o,
java.lang.Integer lock)
Instantiates a new movement thread.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getLock()
Gets the lock object.
|
private Ocean |
getMyOcean()
Gets the ocean.
|
private void |
moveOcean()
Moves the ocean.
|
void |
run() |
void |
setLock(java.lang.Integer lock)
Sets the lock.
|
private void |
setMyOcean(Ocean o)
Sets the my ocean.
|
private void |
sleep()
Sleep.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private static final long serialVersionUID
private java.lang.Integer lock
private Ocean myOcean
public MovementThread(Ocean o, java.lang.Integer lock)
o
- the oceanlock
- the lock objectpublic java.lang.Integer getLock()
private Ocean getMyOcean()
public void setLock(java.lang.Integer lock)
lock
- the new lockprivate void setMyOcean(Ocean o)
o
- the new my oceanprivate void moveOcean()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void sleep()