org.d_haven.event.command
Interface RepeatedCommand

All Superinterfaces:
Command, DelayedCommand

public interface RepeatedCommand
extends DelayedCommand

The RepeatedCommand is used to represent a command that operates at a specified interval over time. It gives the affect of being a long running process without tying up a thread waiting for the next time to run the command.

Author:
Berin Loritsch

Method Summary
 int getNumberOfRepeats()
          If the value is less than 1 (0 or negative), the command repeats for as long as the DefaultCommandManager is running.
 long getRepeatInterval()
          Gets the repeat interval so that the CommandQueue keeps it for the specified amount of time before enqueuing it again.
 
Methods inherited from interface org.d_haven.event.command.DelayedCommand
getDelayInterval
 
Methods inherited from interface org.d_haven.event.command.Command
execute
 

Method Detail

getNumberOfRepeats

int getNumberOfRepeats()
If the value is less than 1 (0 or negative), the command repeats for as long as the DefaultCommandManager is running. If the value is above 0, the Command repeats only for that specific amount of times before it is removed from the system.

Returns:
the number of times the command repeats

getRepeatInterval

long getRepeatInterval()
Gets the repeat interval so that the CommandQueue keeps it for the specified amount of time before enqueuing it again. This value must not be negative.

Returns:
the number of milliseconds between each repeat