wyvern.lib.commands
Class AliasCommand

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.commands.SimpleHandler
          extended bywyvern.lib.commands.AliasCommand
All Implemented Interfaces:
BuiltInCommand, Command, PropertyList

public class AliasCommand
extends SimpleHandler

Lets users set their own persistent server-side aliases.

Version:
1.0, May 01, 2001
Author:
Steve Yegge

Field Summary
 
Fields inherited from class wyvern.kernel.commands.SimpleHandler
delay_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Method Summary
 boolean addAlias(Commandable agent, java.lang.String arg)
          Adds an alias.
 void addCommands(java.util.Map commands, CommandList list)
          Adds commands.
static AliasCommand getImpl()
           
 boolean handleEvent(CommandEvent event)
          Turns alias on or off.
 boolean removeAlias(Commandable agent, java.lang.String arg)
          Remove an alias from the agent's list.
 void showAliases(CommandEvent event)
          Shows teh agent's aliases to the agent.
 
Methods inherited from class wyvern.kernel.commands.SimpleHandler
createEvent, execute, knowsCommand
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getImpl

public static AliasCommand getImpl()

addCommands

public void addCommands(java.util.Map commands,
                        CommandList list)
Adds commands.

Specified by:
addCommands in interface BuiltInCommand
Specified by:
addCommands in class SimpleHandler
Parameters:
list - the CommandList we're associating with, if any
commands - the map to place our commands in.

handleEvent

public boolean handleEvent(CommandEvent event)
Turns alias on or off.

Specified by:
handleEvent in class SimpleHandler
Parameters:
event - a CommandEvent with various fields filled in: the agent performing the command, the command verb and arguments, the delay for the command, and success/failure messages.
Returns:
true if it was completed successfully

addAlias

public boolean addAlias(Commandable agent,
                        java.lang.String arg)
Adds an alias.


removeAlias

public boolean removeAlias(Commandable agent,
                           java.lang.String arg)
Remove an alias from the agent's list.

Parameters:
arg - the alias (first word) and the value (remaining stuff)

showAliases

public void showAliases(CommandEvent event)
Shows teh agent's aliases to the agent.