f00f.net.irc.martyr.commands
Class IsonCommand

java.lang.Object
  extended by f00f.net.irc.martyr.commands.AbstractInCommand
      extended by f00f.net.irc.martyr.commands.AbstractCommand
          extended by f00f.net.irc.martyr.commands.IsonCommand
All Implemented Interfaces:
Command, InCommand, OutCommand

public class IsonCommand
extends AbstractCommand

Defines the ISON command, which is used to determine if a user or a list of users is online.

Author:
Daniel Henninger

Field Summary
static java.lang.String IDENTIFIER_PRIMARY
           
static java.lang.String IDENTIFIER_SECONDARY
           
 
Fields inherited from class f00f.net.irc.martyr.commands.AbstractInCommand
attributes
 
Constructor Summary
IsonCommand()
          No parameter passed to the ISON is not valid.
IsonCommand(java.util.List<java.lang.String> nicks)
          Check online status of a number of nicknames.
IsonCommand(java.lang.String nick)
          Check online status of a single nickname.
IsonCommand(java.lang.String dest, java.util.List<java.lang.String> nicks)
           
IsonCommand(java.lang.String dest, java.lang.String nick)
           
 
Method Summary
 java.lang.String getDest()
          Retrieves the target of the ISON command
 java.lang.String getIrcIdentifier()
          Returns the string IRC uses to identify this command.
 java.util.List<java.lang.String> getNicks()
          Retrieves the list of nicks that are online after an ISON command
 InCommand parse(java.lang.String prefix, java.lang.String identifier, java.lang.String params)
          Parses a string and produces a formed command object, if it can.
 java.lang.String renderParams()
          Renders the parameters of this command.
 void selfRegister(CommandRegister commandRegister)
          Every command should know how to register itself (or not) with the command parsing engine.
 
Methods inherited from class f00f.net.irc.martyr.commands.AbstractCommand
render
 
Methods inherited from class f00f.net.irc.martyr.commands.AbstractInCommand
getAttribute, getAttributeKeys, getIntParameter, getParameter, getSourceString, getState, setAttribute, setSourceString, updateClientState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER_PRIMARY

public static final java.lang.String IDENTIFIER_PRIMARY
See Also:
Constant Field Values

IDENTIFIER_SECONDARY

public static final java.lang.String IDENTIFIER_SECONDARY
See Also:
Constant Field Values
Constructor Detail

IsonCommand

public IsonCommand()
No parameter passed to the ISON is not valid. This is used for factories.


IsonCommand

public IsonCommand(java.lang.String nick)
Check online status of a single nickname.

Parameters:
nick - Nick you want to check the online status of.

IsonCommand

public IsonCommand(java.lang.String dest,
                   java.lang.String nick)

IsonCommand

public IsonCommand(java.util.List<java.lang.String> nicks)
Check online status of a number of nicknames.

Parameters:
nicks - List of nicks you want to check the online status of.

IsonCommand

public IsonCommand(java.lang.String dest,
                   java.util.List<java.lang.String> nicks)
Method Detail

parse

public InCommand parse(java.lang.String prefix,
                       java.lang.String identifier,
                       java.lang.String params)
Description copied from class: AbstractInCommand
Parses a string and produces a formed command object, if it can. Should return null if it cannot form the command object.

Specified by:
parse in interface InCommand
Specified by:
parse in class AbstractInCommand
Parameters:
prefix - Prefix of the command
identifier - ID of the command
params - Parameters of the command
Returns:
InCommand instance for parsed command
See Also:
AbstractInCommand.parse(String, String, String)

renderParams

public java.lang.String renderParams()
Description copied from class: AbstractCommand
Renders the parameters of this command.

Specified by:
renderParams in class AbstractCommand
Returns:
String of rendered parameters
See Also:
AbstractCommand.renderParams()

getIrcIdentifier

public java.lang.String getIrcIdentifier()
Description copied from interface: Command
Returns the string IRC uses to identify this command. Examples: NICK, PING, KILL, 332. Not strictly required for OutCommands as the irc identifier is expected to be part of the reder() result.

Returns:
The IRC identifier string
See Also:
Command.getIrcIdentifier()

selfRegister

public void selfRegister(CommandRegister commandRegister)
Description copied from class: AbstractInCommand
Every command should know how to register itself (or not) with the command parsing engine. If a command is available under mutiple identifiers, then this method can be overridden and the addCommand method can be called multiple times.

Specified by:
selfRegister in interface InCommand
Overrides:
selfRegister in class AbstractInCommand
Parameters:
commandRegister - Command register we want to register with
See Also:
AbstractInCommand.selfRegister(f00f.net.irc.martyr.CommandRegister)

getDest

public java.lang.String getDest()
Retrieves the target of the ISON command

Returns:
Target of command

getNicks

public java.util.List<java.lang.String> getNicks()
Retrieves the list of nicks that are online after an ISON command

Returns:
List of online nicks


Copyright © 2000-2007 Ben Damm, Daniel Henninger, et al.