TickableGroup, CMRunnable, java.lang.Cloneable, java.lang.Runnablepublic class StdTickGroup extends java.lang.Object implements TickableGroup, java.lang.Cloneable
TickableGroup.LocalType| Constructor | Description |
|---|---|
StdTickGroup(long sleep,
java.lang.String threadGroupName,
boolean isSolitary) |
|
StdTickGroup(ThreadEngine theEngine,
long sleep,
java.lang.String threadGroupName,
boolean isSolitary) |
|
StdTickGroup(java.lang.String a_name,
long sleep,
java.lang.String threadGroupName,
boolean isSolitary) |
| Modifier and Type | Method | Description |
|---|---|---|
long |
activeTimeMillis() |
Returns the number of milliseconds this runnable
has been running.
|
void |
addTicker(TickClient C) |
Adds another ticking object to this group
|
boolean |
contains(Tickable T,
int tickID) |
Returns true if this group contains the given ticking object with
the given tickID.
|
StdTickGroup |
copyOf() |
|
boolean |
delTicker(TickClient C) |
Removes the given ticking object from this group
|
TickClient |
fetchTickerByIndex(int i) |
Returns the tickclient at the given index from 0 to numTickers
|
int |
getCounter() |
|
java.lang.Thread |
getCurrentThread() |
If this group is currently getting thread time, this will
return a reference to that thread object, or null otherwise.
|
int |
getGroupID() |
The group identifier for this runnable, which may be used
for executor selection
|
long |
getLastStartTime() |
Returns the time, in ms, that this object last ticked.
|
long |
getLastStopTime() |
Returns the time, in ms, that this object last stopped ticking.
|
TickClient |
getLastTicked() |
Returns the current or last TickClient object which this thread made a tick(Tickable,int) method
call to.
|
java.util.Iterator<TickClient> |
getLocalItems(TickableGroup.LocalType itemTypes,
Room R) |
Returns an iterator of all the items of the given type in the given room.
|
long |
getMilliTotal() |
Returns the number of ms that this object has ticked in total
|
java.lang.String |
getName() |
Returns the name of this group
|
long |
getNextTickTime() |
Returns the next time, in ms, when this group should tick.
|
long |
getStartTime() |
Either the time this runnable did start running, or
will start running, depending on whether it's scheduled
|
java.lang.String |
getStatus() |
Returns the displayable status of this ticking object
|
java.lang.String |
getThreadGroupName() |
Returns the name of the thread group that this ticking group
belongs to (and thus, under which it should run later)
|
long |
getTickInterval() |
Returns the amount of time, in ms, between calls to this group
|
java.util.Iterator<TickClient> |
getTickSet(Tickable T,
int tickID) |
Returns an iterator of all clients matching the given criteria
|
long |
getTickTotal() |
Returns the number of times that this object has ticked in total
|
boolean |
isAwake() |
Returns true if this group currently is getting thread time
|
boolean |
isSolitaryTicker() |
Returns whether this group is only permitted a single object
|
int |
numTickers() |
Returns the number of ticking objects in this group
|
void |
run() |
|
void |
shutdown() |
Orders this group to do any necessary cleanup before going away.
|
java.util.Iterator<TickClient> |
tickers() |
Returns an iterator of all the ticking objects
|
public StdTickGroup(long sleep,
java.lang.String threadGroupName,
boolean isSolitary)
public StdTickGroup(java.lang.String a_name,
long sleep,
java.lang.String threadGroupName,
boolean isSolitary)
public StdTickGroup(ThreadEngine theEngine, long sleep, java.lang.String threadGroupName, boolean isSolitary)
public StdTickGroup copyOf()
public long getStartTime()
CMRunnablegetStartTime in interface CMRunnablepublic int getGroupID()
CMRunnablegetGroupID in interface CMRunnablepublic TickClient fetchTickerByIndex(int i)
TickableGroupfetchTickerByIndex in interface TickableGroupi - the indexTickableGroup.numTickers()public java.lang.Thread getCurrentThread()
TickableGroupgetCurrentThread in interface TickableGrouppublic java.lang.String getThreadGroupName()
TickableGroupgetThreadGroupName in interface TickableGrouppublic long getLastStartTime()
TickableGroupgetLastStartTime in interface TickableGrouppublic long getLastStopTime()
TickableGroupgetLastStopTime in interface TickableGrouppublic long getMilliTotal()
TickableGroupgetMilliTotal in interface TickableGrouppublic long getTickTotal()
TickableGroupgetTickTotal in interface TickableGrouppublic boolean isSolitaryTicker()
TickableGroupisSolitaryTicker in interface TickableGrouppublic boolean isAwake()
TickableGroupisAwake in interface TickableGrouppublic java.util.Iterator<TickClient> tickers()
TickableGrouptickers in interface TickableGrouppublic int numTickers()
TickableGroupnumTickers in interface TickableGrouppublic java.util.Iterator<TickClient> getTickSet(Tickable T, int tickID)
TickableGroupgetTickSet in interface TickableGroupT - the tickable object to look fortickID - the tickid to match, or -1 for allpublic java.util.Iterator<TickClient> getLocalItems(TickableGroup.LocalType itemTypes, Room R)
TickableGroupgetLocalItems in interface TickableGroupitemTypes - 0=mobs or items, 1=items, 2=mobsR - the room to look inpublic java.lang.String getName()
TickableGroupgetName in interface TickableGrouppublic long getTickInterval()
TickableGroupgetTickInterval in interface TickableGrouppublic long getNextTickTime()
TickableGroupgetNextTickTime in interface TickableGrouppublic boolean contains(Tickable T, int tickID)
TickableGroupcontains in interface TickableGroupT - the tickable objecttickID - the tickid to match, or -1 for anypublic int getCounter()
public boolean delTicker(TickClient C)
TickableGroupdelTicker in interface TickableGroupC - the client to removeTickClientpublic void addTicker(TickClient C)
TickableGroupaddTicker in interface TickableGroupC - the client to addTickClientpublic TickClient getLastTicked()
TickableGroupgetLastTicked in interface TickableGroupTickable,
Tickable.tick(Tickable, int)public java.lang.String getStatus()
TickableGroupgetStatus in interface TickableGrouppublic void shutdown()
TickableGroupshutdown in interface TickableGrouppublic void run()
run in interface java.lang.Runnablepublic long activeTimeMillis()
CMRunnableactiveTimeMillis in interface CMRunnable