|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--irc.IRCObject
|
+--irc.RootInterpretor
Root interpretor.
| Field Summary | |
protected Interpretor |
_next
The next interpretor to be used if the command is unknown. |
protected StringParser |
_parser
The used string parser. |
| Fields inherited from class irc.IRCObject |
_ircConfiguration |
| Constructor Summary | |
RootInterpretor(IRCConfiguration config)
Create a new BasicInterpretor without default interpretor. |
|
RootInterpretor(IRCConfiguration config,
Interpretor next)
Create a new BasicInterpretor. |
|
| Method Summary | |
void |
addLast(Interpretor in)
Add the given interpretor at the end of this interpretor chain. |
Interpretor |
getNextInterpretor()
Get the next interpretor. |
protected void |
handleCommand(Source source,
java.lang.String cmd,
java.lang.String[] parts,
java.lang.String[] cumul)
Handle the received command. |
boolean |
isInside(Interpretor in)
Check whether the given interpretor is already in the interpretor chain. |
protected void |
say(Source source,
java.lang.String str)
Say the given text. |
void |
sendString(Source source,
java.lang.String str)
Send the given string to the server. |
void |
setNextInterpretor(Interpretor next)
Set the next interpretor. |
protected void |
test(java.lang.String cmd,
java.lang.String[] parts,
int params)
Test the given command against the expected number of parameters. |
| Methods inherited from class irc.IRCObject |
getColor, getIRCConfiguration, getText, getText, getText, getText, getTimeStamp, release |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected StringParser _parser
protected Interpretor _next
| Constructor Detail |
public RootInterpretor(IRCConfiguration config)
config - the configuration.
public RootInterpretor(IRCConfiguration config,
Interpretor next)
config - the configuration.next - next interpretor to be used if the command is unknown. If null,
the command will be sent as it to the server.| Method Detail |
public void setNextInterpretor(Interpretor next)
Interpretor
setNextInterpretor in interface Interpretornext - interpretor to use. May be null.public Interpretor getNextInterpretor()
Interpretor
getNextInterpretor in interface Interpretorpublic boolean isInside(Interpretor in)
Interpretor
isInside in interface Interpretorin - the interpretor to check.
public void addLast(Interpretor in)
Interpretor
addLast in interface Interpretorin - interpretor to add.
protected void test(java.lang.String cmd,
java.lang.String[] parts,
int params)
throws NotEnoughParametersException
cmd - the hole command line.parts - the parsed command line.params - expected amount of parameters.
NotEnoughParametersException - if there is not enough parameters. That's it :
if parts.length<=params.
protected void handleCommand(Source source,
java.lang.String cmd,
java.lang.String[] parts,
java.lang.String[] cumul)
source - the source that emitted the command.cmd - the hole command line.parts - the parsed command line.cumul - the cumul parsed command line.
public void sendString(Source source,
java.lang.String str)
Interpretor
sendString in interface Interpretorsource - the source.str - the string to send.
protected void say(Source source,
java.lang.String str)
source - the source.str - what to say.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||