barsuift.simLife.process
Interface MainSynchronizer

All Superinterfaces:
Persistent<MainSynchronizerState>, Publisher, Synchronizer

public interface MainSynchronizer
extends Synchronizer, Persistent<MainSynchronizerState>

The main synchronizer allows to synchronize the SynchronizerCore and the Synchronizer3D.


Field Summary
 
Fields inherited from interface barsuift.simLife.process.Synchronizer
CYCLE_LENGTH_3D_MS, CYCLE_LENGTH_CORE_MS
 
Method Summary
 Speed getSpeed()
          Returns the speed of the main synchronizer.
 void oneStep()
          Execute one step of the synchronizer.
 void setSpeed(Speed speed)
          Sets the speed of the current main synchronizer.
 void stopAndWait()
          Stop the synchronizer and sleep until the synchronizer is fully stopped.
 
Methods inherited from interface barsuift.simLife.process.Synchronizer
isRunning, start, stop
 
Methods inherited from interface barsuift.simLife.message.Publisher
addSubscriber, clearChanged, countSubscribers, deleteSubscriber, deleteSubscribers, hasChanged, notifySubscribers, notifySubscribers, setChanged
 
Methods inherited from interface barsuift.simLife.Persistent
getState, synchronize
 

Method Detail

setSpeed

void setSpeed(Speed speed)
Sets the speed of the current main synchronizer.

Parameters:
speed - the speed

getSpeed

Speed getSpeed()
Returns the speed of the main synchronizer.

Returns:
the speed of the synchronizer

oneStep

void oneStep()
Execute one step of the synchronizer.

It is more or less equivalent to calling Synchronizer.start() method, followed by the Synchronizer.stop() method. The additional value of this method is that it guarantees that only one step is executed.

Throws:
java.lang.IllegalStateException - if the synchronizer is already running

stopAndWait

void stopAndWait()
Stop the synchronizer and sleep until the synchronizer is fully stopped.

Throws:
java.lang.IllegalStateException - if the synchronizer is not running


Copyright © 2010. All Rights Reserved.