|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectf00f.net.irc.martyr.commands.ModeCommand
public class ModeCommand
Defines MODE command. Since the MODE command is of two distinct types, this class is really more of a command mini-factory. It determines which type of command it is, either a UserModeCommand or a ChannelModeCommand.
| Field Summary | |
|---|---|
static java.lang.String |
IDENTIFIER
|
| Constructor Summary | |
|---|---|
ModeCommand()
For use as a factory |
|
| Method Summary | |
|---|---|
java.lang.String |
getAttribute(java.lang.String key)
Returns the attribute, or null if the attribute does not exist, or is not defined. |
java.util.Iterator |
getAttributeKeys()
Returns an iterator of String objects over the attribute names for this command. |
java.lang.String |
getIrcIdentifier()
Returns the string IRC uses to identify this command. |
java.lang.String |
getSourceString()
Allows a third party to receive a copy of the raw string. |
State |
getState()
Some commands, when received by the server, can only occur in one state. |
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.util.List<Mode> |
parseModes(java.util.Map<java.lang.Character,Mode> modes,
java.util.StringTokenizer tokens)
Takes a mode string, such as: '+ooo A B C' or '+o A +o B' or even '+o-o A B' and returns a List containing Mode objects that correspond to the modes specified. |
static void |
registerMode(java.util.Map<java.lang.Character,Mode> modes,
Mode mode)
|
java.lang.String |
render()
Should not be called, as ModeCommand doesn't actually represent a command. |
void |
selfRegister(CommandRegister reg)
Every incoming command should know how to register itself with the command register. |
void |
setSourceString(java.lang.String source)
Gives the command a copy of the raw string from the server. |
java.lang.String |
toString()
|
boolean |
updateClientState(ClientState cs)
Does nothing, as this is a factory command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String IDENTIFIER
| Constructor Detail |
|---|
public ModeCommand()
| Method Detail |
|---|
public java.util.Iterator getAttributeKeys()
InCommand
getAttributeKeys in interface InCommandpublic java.lang.String getAttribute(java.lang.String key)
InCommand
getAttribute in interface InCommandkey - Attribute to get value of
public static void registerMode(java.util.Map<java.lang.Character,Mode> modes,
Mode mode)
public State getState()
InCommand
getState in interface InCommandpublic void selfRegister(CommandRegister reg)
InCommand
selfRegister in interface InCommandreg - Command register we want to register withpublic java.lang.String getIrcIdentifier()
Command
getIrcIdentifier in interface Command
public InCommand parse(java.lang.String prefix,
java.lang.String identifier,
java.lang.String params)
InCommand
parse in interface InCommandprefix - Prefix of the commandidentifier - ID of the commandparams - Parameters of the command
public java.lang.String render()
render in interface OutCommandpublic void setSourceString(java.lang.String source)
InCommand
setSourceString in interface InCommandsource - Sets the source string to be parsedpublic java.lang.String getSourceString()
InCommand
getSourceString in interface InCommandpublic boolean updateClientState(ClientState cs)
updateClientState in interface InCommandcs - Client state to be updated
public java.lang.String toString()
toString in class java.lang.Object
public java.util.List<Mode> parseModes(java.util.Map<java.lang.Character,Mode> modes,
java.util.StringTokenizer tokens)
modes - is a Map of Character to Mode objects.tokens - is the sequence of tokens making up the parameters of
the command.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||