f00f.net.irc.martyr.commands
Class ChannelModeCommand

java.lang.Object
  extended by f00f.net.irc.martyr.commands.ModeCommand
      extended by f00f.net.irc.martyr.commands.ChannelModeCommand
All Implemented Interfaces:
Command, InCommand, OutCommand

public class ChannelModeCommand
extends ModeCommand

Defines the ChannelMode command. Can be used to send a Channel mode. For receiving, this defines which channel modes Martyr knows about and passes them on to the Channel object. Note that the actual logic of what happens when a mode arrives lies in the clientstate.Channel object.


Field Summary
 
Fields inherited from class f00f.net.irc.martyr.commands.ModeCommand
IDENTIFIER
 
Constructor Summary
ChannelModeCommand(java.lang.String channelName)
          For sending a mode discovery.
ChannelModeCommand(java.lang.String prefix, java.lang.String channelName, java.util.StringTokenizer params)
          For receiving a mode command.
 
Method Summary
 java.lang.String getChannel()
           
 java.lang.String getPrefix()
           
 FullNick getSender()
           
 void makeModes()
           
 InCommand parse(java.lang.String prefix, java.lang.String identifier, java.lang.String params)
          Shouldn't be called, as ModeCommand should be responsible for parsing and creating this class.
 java.lang.String render()
          Should not be called, as ModeCommand doesn't actually represent a command.
 java.lang.String renderParams()
           
 boolean updateClientState(ClientState state)
          Passes the modes on to the clientstate.Channel object.
 
Methods inherited from class f00f.net.irc.martyr.commands.ModeCommand
getAttribute, getAttributeKeys, getIrcIdentifier, getSourceString, getState, parseModes, registerMode, selfRegister, setSourceString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChannelModeCommand

public ChannelModeCommand(java.lang.String prefix,
                          java.lang.String channelName,
                          java.util.StringTokenizer params)
For receiving a mode command.

Parameters:
prefix - Currently unused prefix string
channelName - Channel that the mode change is in reference to
params - List of params to be parsed

ChannelModeCommand

public ChannelModeCommand(java.lang.String channelName)
For sending a mode discovery.

Parameters:
channelName - Channel that the mode change is in reference to
Method Detail

makeModes

public void makeModes()

parse

public InCommand parse(java.lang.String prefix,
                       java.lang.String identifier,
                       java.lang.String params)
Shouldn't be called, as ModeCommand should be responsible for parsing and creating this class.

Specified by:
parse in interface InCommand
Overrides:
parse in class ModeCommand
Parameters:
prefix - Prefix of the command
identifier - ID of the command
params - Parameters of the command
Returns:
InCommand instance for parsed command

render

public java.lang.String render()
Description copied from class: ModeCommand
Should not be called, as ModeCommand doesn't actually represent a command. Use UserModeCommand or ChannelModeCommand instead.

Specified by:
render in interface OutCommand
Overrides:
render in class ModeCommand
Returns:
Rendered string

renderParams

public java.lang.String renderParams()

getChannel

public java.lang.String getChannel()

getSender

public FullNick getSender()

getPrefix

public java.lang.String getPrefix()

updateClientState

public boolean updateClientState(ClientState state)
Passes the modes on to the clientstate.Channel object.

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


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