All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ejmf.toolkit.multiplayer.MixerEvent

java.lang.Object
   |
   +----ejmf.toolkit.multiplayer.MixerEvent

public class MixerEvent
extends Object
implements Sortable
A MixerEvent encapsulates a time-based operation on a Player.

A MixerEvent maintains a pair: time and command. The command is executed at the specified time offset. The time represents the offset from some arbitrary start time. The command is an instance of MixerCommand.

MixerEvent implements the Sortable interface so that a collection of them can be easily sort according to their time offset.

See Also:
MixerCommand, Track

Constructor Index

 o MixerEvent(MixerCommand, long)
Create a MixerEvent specifying its command/time pair completely.

Method Index

 o execute()
Execute the command associated with MixerEvent
 o getCommand()
Get the MixerCommand associated with this MixerEvent.
 o getTime()
Get the time offset at which this MixerEvent's command is to be executed.
 o lessThan(Sortable)
Determine whether this MixerEvent's command is executed before another MixerEvent's command.
 o setTime(long)
Set the time offset at which this MixerEvent's command is to be executed.

Constructors

 o MixerEvent
 public MixerEvent(MixerCommand cmd,
                   long time)
Create a MixerEvent specifying its command/time pair completely. Time is offset from arbitrary start time.

Parameters:
cmd - MixerCommand command to be executed at given time
time - Time, in milliseconds at which command is executed.

Methods

 o setTime
 public void setTime(long time)
Set the time offset at which this MixerEvent's command is to be executed.

Parameters:
time - Time, in milliseconds at which command is executed.
 o getTime
 public long getTime()
Get the time offset at which this MixerEvent's command is to be executed.

Returns:
Command execution offset.
 o lessThan
 public boolean lessThan(Sortable s)
Determine whether this MixerEvent's command is executed before another MixerEvent's command. This method implements Sortable interface required by quick sort. It tests if if this event's time offset is smaller than one passed as argument.

Parameters:
s - a Sortable
See Also:
Sortable, QuickSort
 o getCommand
 public MixerCommand getCommand()
Get the MixerCommand associated with this MixerEvent.

Returns:
A MixerCommand associated with this event.
 o execute
 public void execute()
Execute the command associated with MixerEvent


All Packages  Class Hierarchy  This Package  Previous  Next  Index