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
           
 ThreadEngine myEngine
           
protected  int numTickers
           
protected  boolean shutdown
           
 boolean solitaryTicker
           
 long TICK_TIME
           
protected  java.util.Vector tickers
           
 long tickTotal
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.TickableGroup
MAX_TICK_CLIENTS
 
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 fetchTicker(int i)
           
 int getCounter()
           
protected  int getIndex(Tickable T)
           
 java.util.Vector getLocalItems(int itemTypes, Room R)
           
 java.util.Iterator 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 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

lastStart

public long lastStart

lastStop

public long lastStop

milliTotal

public long milliTotal

tickTotal

public long tickTotal

myEngine

public ThreadEngine myEngine

solitaryTicker

public boolean solitaryTicker

TICK_TIME

public long TICK_TIME

tickers

protected java.util.Vector tickers

numTickers

protected int numTickers

shutdown

protected boolean shutdown

awake

public boolean awake

lastClient

public TockClient lastClient
Constructor Detail

Tick

public Tick(ThreadEngine theEngine,
            long sleep)

Tick

public Tick(long sleep)

Tick

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

copyOf

public Tick copyOf()

getIndex

protected int getIndex(Tickable T)

tickers

public java.util.Iterator tickers()

numTickers

public int numTickers()

fetchTicker

public TockClient fetchTicker(int i)

getTickSet

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

getLocalItems

public java.util.Vector 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)

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