net.jetrix.messages
Class CommandMessage

java.lang.Object
  extended by net.jetrix.Message
      extended by net.jetrix.messages.ChannelMessage
          extended by net.jetrix.messages.TextMessage
              extended by net.jetrix.messages.PlineMessage
                  extended by net.jetrix.messages.CommandMessage

public class CommandMessage
extends PlineMessage

A /command.

Version:
$Revision: 482 $, $Date: 2004-12-10 13:40:44 +0100 (ven., 10 déc. 2004) $
Author:
Emmanuel Bourg

Constructor Summary
CommandMessage()
           
 
Method Summary
 void addParameter(String obj)
          Add a parameter to the command.
 Channel getChannelParameter(int i)
          Returns the channel associated to the i-th parameter of the command.
 Client getClientParameter(int i)
          Return the Client object associated to the i-th parameter of the command.
 String getCommand()
           
 Integer getIntegerParameter(int i)
          Return an integer parameter, or null if the specified parameter doesn't map to an integer value.
 int getIntParameter(int i, int defaultValue)
          Return an integer parameter, or the default value if the specified parameter doesn't map to an integer value.
 String getParameter(int i)
           
 int getParameterCount()
          Return the number of parameters on this command.
 void setCommand(String command)
           
 
Methods inherited from class net.jetrix.messages.TextMessage
getKey, getRawMessage, getText, getText, setKey, setText
 
Methods inherited from class net.jetrix.messages.ChannelMessage
getChannel, getSlot, setChannel, setSlot
 
Methods inherited from class net.jetrix.Message
getDestination, getSource, getTime, setDestination, setRawMessage, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandMessage

public CommandMessage()
Method Detail

getCommand

public String getCommand()

setCommand

public void setCommand(String command)

getParameter

public String getParameter(int i)

getIntParameter

public int getIntParameter(int i,
                           int defaultValue)
Return an integer parameter, or the default value if the specified parameter doesn't map to an integer value.

Parameters:
i - the index of the parameter
defaultValue - the default value

getIntegerParameter

public Integer getIntegerParameter(int i)
Return an integer parameter, or null if the specified parameter doesn't map to an integer value.

Parameters:
i - the index of the parameter

getClientParameter

public Client getClientParameter(int i)
Return the Client object associated to the i-th parameter of the command. The client can be specified as a slot number if he is in the same channel as the client issuing the command, or as a case insensitive name. If no client matches the specified parameter a null value is returned.


getChannelParameter

public Channel getChannelParameter(int i)
Returns the channel associated to the i-th parameter of the command. The channel can be specified by a partial name or by its number. If no channel matches the specified parameter a null value is returned.


addParameter

public void addParameter(String obj)
Add a parameter to the command.


getParameterCount

public int getParameterCount()
Return the number of parameters on this command.



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