See on Tõrva Gümnaasiumi vana veebilehe arhiiv. Uus veebileht: https://torva.edu.ee/

BasicInterpretor (PJIRC project)

Lisamaterjalide loend

Algne fail: vana_veeb/pjirc/doc/javadoc/irc/BasicInterpretor.html.

========== START OF NAVBAR ==========
=========== END OF NAVBAR ===========
======== START OF CLASS DATA ========

irc
Class BasicInterpretor

java.lang.Object
  |
  +--irc.IRCObject
        |
        +--irc.BasicInterpretor
All Implemented Interfaces:
Interpretor
Direct Known Subclasses:
DCCChatInterpretor, IRCInterpretor

public class BasicInterpretor
extends IRCObject
implements Interpretor

Root class for all interpretors.


Field Summary
protected  CTCPFilter _filter
          The CTCPFilter.
protected  StringParser _parser
          The used string parser.
 
Fields inherited from class irc.IRCObject
_ircConfiguration
 
Constructor Summary
BasicInterpretor(IRCConfiguration config, CTCPFilter filter)
          Create a new BasicInterpretor.
 
Method Summary
protected  void handleCommand(Source source, java.lang.String cmd, java.lang.String[] parts, java.lang.String[] cumul)
          Handle the received command.
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.
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_parser

protected StringParser _parser
The used string parser.


_filter

protected CTCPFilter _filter
The CTCPFilter.

Constructor Detail

BasicInterpretor

public BasicInterpretor(IRCConfiguration config,
                        CTCPFilter filter)
Create a new BasicInterpretor.

Parameters:
config - the configuration.
filter - the CTCPFilter to use.

Method Detail

test

protected void test(java.lang.String cmd,
                    java.lang.String[] parts,
                    int params)
             throws NotEnoughParametersException
Test the given command against the expected number of parameters.

Parameters:
cmd - the hole command line.
parts - the parsed command line.
params - expected amount of parameters.
Throws:
NotEnoughParametersException - if there is not enough parameters. That's it : if parts.length<=params.


handleCommand

protected void handleCommand(Source source,
                             java.lang.String cmd,
                             java.lang.String[] parts,
                             java.lang.String[] cumul)
Handle the received command.

Parameters:
source - the source that emitted the command.
cmd - the hole command line.
parts - the parsed command line.
cumul - the cumul parsed command line.


sendString

public void sendString(Source source,
                       java.lang.String str)
Description copied from interface: Interpretor
Send the given string to the server.

Specified by:
sendString in interface Interpretor
Parameters:
source - the source.
str - the string to send.


say

protected void say(Source source,
                   java.lang.String str)
Say the given text.

Parameters:
source - the source.
str - what to say.