me.escapeNT.pail.scheduler
Class ConsoleCommandTask

java.lang.Object
  extended by me.escapeNT.pail.scheduler.ConsoleCommandTask
All Implemented Interfaces:
Serializable, ScheduledTask

public class ConsoleCommandTask
extends Object
implements ScheduledTask

Class representing a console command task.

Author:
escapeNT
See Also:
Serialized Form

Constructor Summary
ConsoleCommandTask(String command, boolean repeating, long interval, String name)
           
 
Method Summary
 void execute()
          Executes the task by dispatching the command.
 String getCommand()
          Gets the command to be executed.
 long getInterval()
          Gets the time interval between executions of this task.
 String getName()
          Gets the name of the specific task.
 boolean isEnabled()
          Gets whether the task is enabled and running.
 boolean isRepeating()
          Returns true if the task should be repeated indefinitely.
 void setEnabled(boolean enabled)
          Sets whether the task is enabled and running.
 void setName(String name)
          Sets the task name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleCommandTask

public ConsoleCommandTask(String command,
                          boolean repeating,
                          long interval,
                          String name)
Method Detail

getInterval

public long getInterval()
Description copied from interface: ScheduledTask
Gets the time interval between executions of this task.

Specified by:
getInterval in interface ScheduledTask
Returns:
The interval in milliseconds between task executions.

isRepeating

public boolean isRepeating()
Description copied from interface: ScheduledTask
Returns true if the task should be repeated indefinitely.

Specified by:
isRepeating in interface ScheduledTask
Returns:
True if the task is repeating, false if not.

getCommand

public String getCommand()
Gets the command to be executed.

Returns:
the command The command String.

execute

public void execute()
Executes the task by dispatching the command.

Specified by:
execute in interface ScheduledTask

isEnabled

public boolean isEnabled()
Description copied from interface: ScheduledTask
Gets whether the task is enabled and running.

Specified by:
isEnabled in interface ScheduledTask
Returns:
True if the task is enabled.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: ScheduledTask
Sets whether the task is enabled and running.

Specified by:
setEnabled in interface ScheduledTask
Parameters:
enabled - True if the task will be enabled, false if disabled.

getName

public String getName()
Description copied from interface: ScheduledTask
Gets the name of the specific task.

Specified by:
getName in interface ScheduledTask
Returns:
the name

setName

public void setName(String name)
Description copied from interface: ScheduledTask
Sets the task name.

Specified by:
setName in interface ScheduledTask
Parameters:
name - the name to set


Copyright © 2011. All Rights Reserved.