f00f.net.irc.martyr.commands
Class WelcomeCommand

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

public class WelcomeCommand
extends AbstractInCommand

Defines the commands that a server issues to welcome us. These are identified with 001, 002... etc. These commands are only received after we register, unlike the NOTICE command.


Field Summary
 
Fields inherited from class f00f.net.irc.martyr.commands.AbstractInCommand
attributes
 
Constructor Summary
WelcomeCommand()
          Factory
WelcomeCommand(java.lang.String nick, java.lang.String notice)
          Used by parse to create an instance of WelcomeCommand.
 
Method Summary
 java.lang.String getIrcIdentifier()
          Returns the string IRC uses to identify this command.
 java.lang.String getNick()
           
 java.lang.String getNotice()
           
 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.
 void selfRegister(CommandRegister commandRegister)
          Every command should know how to register itself (or not) with the command parsing engine.
 java.lang.String toString()
           
 boolean updateClientState(ClientState state)
          Sets the nick of the client state, if there is one included with this command.
 
Methods inherited from class f00f.net.irc.martyr.commands.AbstractInCommand
getAttribute, getAttributeKeys, getIntParameter, getParameter, getSourceString, getState, setAttribute, setSourceString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WelcomeCommand

public WelcomeCommand()
Factory


WelcomeCommand

public WelcomeCommand(java.lang.String nick,
                      java.lang.String notice)
Used by parse to create an instance of WelcomeCommand.

Parameters:
nick - Nick that send the welcome
notice - Notice that was sent
Method Detail

parse

public 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. 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

updateClientState

public boolean updateClientState(ClientState state)
Sets the nick of the client state, if there is one included with this command.

Specified by:
updateClientState in interface InCommand
Overrides:
updateClientState in class AbstractInCommand
Parameters:
state - Client state to be updated
Returns:
True or false if changes were made

getIrcIdentifier

public java.lang.String getIrcIdentifier()
Returns the string IRC uses to identify this command. Examples: NICK, PING, KILL, 332. In our case, there is no one thing.

Returns:
The IRC identifier string

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

getNotice

public java.lang.String getNotice()

getNick

public java.lang.String getNick()
Returns:
the nick received with this command, or null if there isn't one.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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