com.planet_ink.coffee_mud.core.threads
Class Tick

java.lang.Object
  extended by java.lang.Thread
      extended by com.planet_ink.coffee_mud.core.threads.Tick
All Implemented Interfaces:
TickableGroup, java.lang.Cloneable, java.lang.Runnable

public class Tick
extends java.lang.Thread
implements TickableGroup, java.lang.Cloneable


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 boolean awake
           
 TockClient lastClient
           
 long lastStart
           
 long lastStop
           
 long milliTotal
           
 boolean solitaryTicker
           
 long TICK_TIME
           
 long tickTotal
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Tick(long sleep)
           
Tick(java.lang.String a_name, long sleep)
           
Tick(ThreadEngine theEngine, long sleep)
           
 
Method Summary
 void addTicker(TockClient C)
           
 boolean contains(Tickable T, int tickID)
           
 Tick copyOf()
           
 void delTicker(TockClient C)
           
 TockClient fetchTickerByIndex(int i)
           
 int getCounter()
           
 java.util.Iterator<TockClient> getLocalItems(int itemTypes, Room R)
           
 java.lang.String getStatus()
           
 java.util.Iterator<TockClient> getTickSet(Tickable T, int tickID)
           
 Tickable lastTicked()
          Returns the current or last Tickable object which this thread made a tick(Tickable,int) method call to.
 int numTickers()
           
 void run()
           
 void shutdown()
           
 java.util.Iterator<TockClient> tickers()
           
static boolean tickTicker(TockClient C, boolean allSuspended)
           
 
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
 

Field Detail

TICK_TIME

public final long TICK_TIME

lastStart

public volatile long lastStart

lastStop

public volatile long lastStop

milliTotal

public volatile long milliTotal

tickTotal

public volatile long tickTotal

solitaryTicker

public volatile boolean solitaryTicker

awake

public volatile boolean awake

lastClient

public volatile TockClient lastClient
Constructor Detail

Tick

public Tick(long sleep)

Tick

public Tick(java.lang.String a_name,
            long sleep)

Tick

public Tick(ThreadEngine theEngine,
            long sleep)
Method Detail

copyOf

public Tick copyOf()

fetchTickerByIndex

public TockClient fetchTickerByIndex(int i)

tickers

public java.util.Iterator<TockClient> tickers()

numTickers

public int numTickers()

getTickSet

public java.util.Iterator<TockClient> getTickSet(Tickable T,
                                                 int tickID)

getLocalItems

public java.util.Iterator<TockClient> getLocalItems(int itemTypes,
                                                    Room R)

contains

public boolean contains(Tickable T,
                        int tickID)

getCounter

public int getCounter()

delTicker

public void delTicker(TockClient C)

addTicker

public void addTicker(TockClient C)

lastTicked

public Tickable lastTicked()
Description copied from interface: TickableGroup
Returns the current or last Tickable object which this thread made a tick(Tickable,int) method call to.

Specified by:
lastTicked in interface TickableGroup
Returns:
the Tickable object last accessed
See Also:
Tickable, Tickable.tick(Tickable, int)

getStatus

public java.lang.String getStatus()

shutdown

public void shutdown()

tickTicker

public static boolean tickTicker(TockClient C,
                                 boolean allSuspended)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread