org.xith3d.loop.opscheduler
Interface OperationScheduler

All Superinterfaces:
Animator, Updatable, Updater
All Known Implementing Classes:
DummyOperationSchedulerImpl, OperationSchedulerImpl, OperationSchedulerQueue

public interface OperationScheduler
extends Animator, Updater, Updatable

An OperationScheduler is capable of handling ScheduledOperations, which are to be executed by the render thread.
This way SceneGraph manipulations can be done thread safely.


Method Summary
 void addInterval(Interval interval)
          Adds a new Interval to the scheduler, which will be checked each iteration.
 void addIntervalListener(IntervalListener l)
          Registers a new IntervalListner to this OperationScheduler.
 void removeAllIntervals()
          Removes all Intervals from the scheduler.
 IntervalListener removeIntervalListener(IntervalListener l)
          Unregisters an IntervalListner from this OperationScheduler.
 void scheduleOperation(ScheduledOperation schedOp)
          Adds a ScheduledOperation to the queue.
 void unscheduleOperation(ScheduledOperation schedOp)
          Removes a ScheduledOperation from the queue.
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from interface org.xith3d.loop.opscheduler.Animator
addAnimatableObject, addAnimatableObject, removeAnimatableObject
 
Methods inherited from interface org.xith3d.loop.Updater
addUpdatable, removeUpdatable
 

Method Detail

scheduleOperation

void scheduleOperation(ScheduledOperation schedOp)
Adds a ScheduledOperation to the queue. The loop works off the queue each iteration.

Parameters:
schedOp - the Operation to schedule

unscheduleOperation

void unscheduleOperation(ScheduledOperation schedOp)
Removes a ScheduledOperation from the queue.

Parameters:
schedOp - the Operation to unschedule

addInterval

void addInterval(Interval interval)
Adds a new Interval to the scheduler, which will be checked each iteration. When the check() method returns true, all IntervalListeners are notified. This method immediately invokes the revive() method of the given Interval.

Parameters:
interval - the new Interval

removeAllIntervals

void removeAllIntervals()
Removes all Intervals from the scheduler.


addIntervalListener

void addIntervalListener(IntervalListener l)
Registers a new IntervalListner to this OperationScheduler.

Parameters:
l - the new IntervalListener

removeIntervalListener

IntervalListener removeIntervalListener(IntervalListener l)
Unregisters an IntervalListner from this OperationScheduler.

Parameters:
l - the IntervalListener to remove

update

void update(long gameTime,
            long frameTime,
            UpdatingThread.TimingMode timingMode)
Updates this Updatable object.

Specified by:
update in interface Animator
Specified by:
update in interface Updatable
Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.