anecho.JamochaMUD.plugins.ticker
Class Tick

java.lang.Object
  extended by java.lang.Thread
      extended by anecho.JamochaMUD.plugins.ticker.Tick
All Implemented Interfaces:
java.lang.Runnable

public class Tick
extends java.lang.Thread

This class maintains all the tick information for a specific MU*. A tick class is assigned to each MU* to keep track of warnings, ticksizes, etc.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Tick()
           
 
Method Summary
 void endThread()
          This method should "safely" end the thread by changing our running variable to false.
 int getDeadTickSize()
          This method is for returning the tick size of a dead thread.
 MuSocket getMU()
           
 int getTickSize()
          Returns the size (duration) of the tick
 int getTimeRemaining()
          Returns the number of seconds remaining before the next tick
 boolean isLive()
          Indicates whether this thread is live or not.
 void run()
          This is our main method that handles the ticking
 void setMU(MuSocket inMuck)
          Sets the MuSocket that this tick is associated with
 void setSize(int size)
          Set the size (duration) of the tick in seconds
 void setStart(long startTime)
           
 void setStartNow()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tick

public Tick()
Method Detail

setMU

public void setMU(MuSocket inMuck)
Sets the MuSocket that this tick is associated with

Parameters:
inMuck - The MuSocket associated with this Tick

getMU

public MuSocket getMU()
Returns:

setStart

public void setStart(long startTime)
Parameters:
startTime -

setStartNow

public void setStartNow()

setSize

public void setSize(int size)
Set the size (duration) of the tick in seconds

Parameters:
size - Duration of the tick in seconds.

endThread

public void endThread()
This method should "safely" end the thread by changing our running variable to false.


getTickSize

public int getTickSize()
Returns the size (duration) of the tick

Returns:
Size of tick in seconds

getDeadTickSize

public int getDeadTickSize()
This method is for returning the tick size of a dead thread. Thie method should only be used for getting the size of the previous thread.

Returns:
The tick size of the previously running thread.

getTimeRemaining

public int getTimeRemaining()
Returns the number of seconds remaining before the next tick

Returns:
Number of seconds

isLive

public boolean isLive()
Indicates whether this thread is live or not. A thread may be live but not running if the thread has been created but not yet started.

Returns:
true - this thread is alive false - this thread is no long alive

run

public void run()
This is our main method that handles the ticking

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread