net.jetrix.commands
Class AbstractCommand

java.lang.Object
  extended by net.jetrix.commands.AbstractCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AwayCommand, BroadcastCommand, ConfigCommand, EmoteCommand, GotoCommand, HelpCommand, IgnoreCommand, IpCommand, JoinCommand, KickCommand, LanguageCommand, ListCommand, ModeCommand, MotdCommand, MoveCommand, OperatorCommand, PauseCommand, PetitionCommand, PingCommand, RandomCommand, ReplyCommand, SpecListCommand, StartCommand, StopCommand, SummonCommand, TeamMessageCommand, TeleportCommand, TellCommand, TimeCommand, VersionCommand, WhoCommand

public abstract class AbstractCommand
extends Object
implements Command

Abstract command.

Since:
0.2
Version:
$Revision: 545 $, $Date: 2005-01-05 18:16:04 +0100 (mer., 05 janv. 2005) $
Author:
Emmanuel Bourg

Field Summary
protected  boolean hidden
           
protected  int level
           
protected static Logger log
           
 
Constructor Summary
AbstractCommand()
           
 
Method Summary
 int getAccessLevel()
          Return the required access level to execute this command.
protected  String getAlias()
          Return the command alias.
 String[] getAliases()
          Return the different names available to invoke this command.
 String getDescription(Locale locale)
          Return a description of this command.
 String getUsage(Locale locale)
          Return the usage of this command, for example /cmd <param1> <param2>
 boolean isHidden()
          Tells if the command is hidden from the /help list.
 void setAccessLevel(int level)
          Set the access level required to execute this command.
 void setHidden(boolean hidden)
          Change the hidden status of the command on the /help list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.jetrix.commands.Command
execute
 

Field Detail

level

protected int level

hidden

protected boolean hidden

log

protected static Logger log
Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

getAccessLevel

public int getAccessLevel()
Description copied from interface: Command
Return the required access level to execute this command.

Specified by:
getAccessLevel in interface Command

setAccessLevel

public void setAccessLevel(int level)
Description copied from interface: Command
Set the access level required to execute this command.

Specified by:
setAccessLevel in interface Command
Parameters:
level - the access level

isHidden

public boolean isHidden()
Description copied from interface: Command
Tells if the command is hidden from the /help list.

Specified by:
isHidden in interface Command

setHidden

public void setHidden(boolean hidden)
Description copied from interface: Command
Change the hidden status of the command on the /help list.

Specified by:
setHidden in interface Command

getUsage

public String getUsage(Locale locale)
Description copied from interface: Command
Return the usage of this command, for example /cmd <param1> <param2>

Specified by:
getUsage in interface Command
Parameters:
locale - the locale to be used for the usage

getDescription

public String getDescription(Locale locale)
Description copied from interface: Command
Return a description of this command.

Specified by:
getDescription in interface Command
Parameters:
locale - the locale to be used for the description

getAlias

protected String getAlias()
Return the command alias. This is a method to be overriden only by commands with a unique alias.


getAliases

public String[] getAliases()
Description copied from interface: Command
Return the different names available to invoke this command. An alias doesn't contain the leading character used to call a command ("/" or "!"). The first alias in the array is the default name that will be displayed in the /help list.

Specified by:
getAliases in interface Command


Copyright © 2001-2008 Emmanuel Bourg. All Rights Reserved.