|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.tudey.server.util.SceneTicker
public abstract class SceneTicker
Ticks some number of scene managers.
| Nested Class Summary | |
|---|---|
static class |
SceneTicker.DedicatedThread
Ticks the scenes on a dedicated thread. |
static class |
SceneTicker.EventThread
Ticks the scenes on the event thread. |
| Field Summary | |
|---|---|
protected int |
_actualInterval
The average actual interval. |
protected TruncatedAverage |
_intervalAverage
The trailing average of the actual intervals. |
protected boolean |
_lastLong
Whether the last tick was considered "long." |
protected long |
_lastTick
The time of the last tick. |
protected RunQueue |
_runQueue
The event thread run queue. |
protected TudeySceneManager[] |
_sarray
Holds the scene managers during processing. |
protected List<TudeySceneManager> |
_scenemgrs
The list of scene managers to tick. |
protected int |
_targetInterval
The target interval. |
| Constructor Summary | |
|---|---|
SceneTicker(RunQueue runQueue,
int targetInterval)
Creates a new scene ticker. |
|
| Method Summary | |
|---|---|
void |
add(TudeySceneManager scenemgr)
Adds a scene manager to be ticked. |
boolean |
contains(TudeySceneManager scenemgr)
Checks whether the specified scene manager is being ticked. |
int |
getActualInterval()
Returns the average actual interval. |
void |
remove(TudeySceneManager scenemgr)
Removes a scene manager. |
void |
setTargetInterval(int interval)
Sets the target interval. |
protected abstract void |
start()
Starts ticking. |
protected abstract void |
stop()
Stops ticking. |
protected long |
tick()
Ticks the scene managers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RunQueue _runQueue
protected volatile int _targetInterval
protected volatile int _actualInterval
protected List<TudeySceneManager> _scenemgrs
protected TudeySceneManager[] _sarray
protected long _lastTick
protected boolean _lastLong
protected TruncatedAverage _intervalAverage
| Constructor Detail |
|---|
public SceneTicker(RunQueue runQueue,
int targetInterval)
| Method Detail |
|---|
public void setTargetInterval(int interval)
public int getActualInterval()
public void add(TudeySceneManager scenemgr)
public void remove(TudeySceneManager scenemgr)
public boolean contains(TudeySceneManager scenemgr)
protected abstract void start()
protected abstract void stop()
protected long tick()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||