irc
Class Source

java.lang.Object
  |
  +--irc.IRCObject
        |
        +--irc.Source
Direct Known Subclasses:
DCCFile, DCCSource, DefaultSource, IRCSource

public abstract class Source
extends IRCObject

The root source.


Field Summary
protected  Interpretor _in
          The interpretor.
protected  Server _server
          The server.
 
Fields inherited from class irc.IRCObject
_ircConfiguration
 
Constructor Summary
Source(IRCConfiguration config, Server s)
          Create a new Source.
 
Method Summary
 void action(java.lang.String nick, java.lang.String msg)
          Notify this source a new action message has arrived.
 void activate()
          Activate this source.
 void addSourceListener(SourceListener lis)
          Add a new SourceListener.
 void clear()
          Request this source to clear all the history it could have.
 Interpretor getInterpretor()
          Get this source's interpretor.
abstract  java.lang.String getName()
          Get this source name.
 Server getServer()
          Get the source server.
abstract  java.lang.String getType()
          Get this source type.
 boolean isActive()
          Test wether this source is active.
abstract  void leave()
          Request to leave (close) this source.
 boolean mayDefault()
          Test whether this source may be used as a default source for system event output.
 void messageReceived(java.lang.String source, java.lang.String msg)
          Notify this source a new message has arrived.
 void noticeReceived(java.lang.String source, java.lang.String msg)
          Notify this source a new notice message has arrived.
 void release()
          Release this object.
 void removeSourceListener(SourceListener lis)
          Remove a SourceListener.
 void report(java.lang.String msg)
          Notify this source a new report has arrived.
 void sendString(java.lang.String str)
          Send a string from user input to this source.
 void setCTCPFilter(CTCPFilter filter)
          Set this source's CTCPFilter.
 void setInterpretor(Interpretor in)
          Set this source's interpretor.
abstract  boolean talkable()
          Test wether this source can accept messages from user.
 
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

_server

protected Server _server
The server.


_in

protected Interpretor _in
The interpretor.

Constructor Detail

Source

public Source(IRCConfiguration config,
              Server s)
Create a new Source.

Parameters:
config - the global configuration.
s - the bound server.
Method Detail

release

public void release()
Description copied from class: IRCObject
Release this object. No further method call can be performed on this object.

Overrides:
release in class IRCObject

getName

public abstract java.lang.String getName()
Get this source name.

Returns:
source name.

getType

public abstract java.lang.String getType()
Get this source type.

Returns:
source type.

talkable

public abstract boolean talkable()
Test wether this source can accept messages from user.

Returns:
true if this source accepts user input, false otherwise.

leave

public abstract void leave()
Request to leave (close) this source.


setInterpretor

public void setInterpretor(Interpretor in)
Set this source's interpretor.

Parameters:
in - new interpretor.

setCTCPFilter

public void setCTCPFilter(CTCPFilter filter)
Set this source's CTCPFilter.

Parameters:
filter - new CTCPFilter.

sendString

public void sendString(java.lang.String str)
Send a string from user input to this source.

Parameters:
str - user input.

getInterpretor

public Interpretor getInterpretor()
Get this source's interpretor.

Returns:
this source's interpretor.

clear

public void clear()
Request this source to clear all the history it could have.


messageReceived

public void messageReceived(java.lang.String source,
                            java.lang.String msg)
Notify this source a new message has arrived.

Parameters:
source - the source of the message. It can be a user nickname or a channel name.
msg - the message.

noticeReceived

public void noticeReceived(java.lang.String source,
                           java.lang.String msg)
Notify this source a new notice message has arrived.

Parameters:
source - the source of the message. It can be a user nickname or a channel name.
msg - the message.

action

public void action(java.lang.String nick,
                   java.lang.String msg)
Notify this source a new action message has arrived.

Parameters:
nick - the user who sent the action.
msg - the message.

report

public void report(java.lang.String msg)
Notify this source a new report has arrived.

Parameters:
msg - the report message.

addSourceListener

public void addSourceListener(SourceListener lis)
Add a new SourceListener.

Parameters:
lis - listener to add.

removeSourceListener

public void removeSourceListener(SourceListener lis)
Remove a SourceListener.

Parameters:
lis - the listener to remove.

activate

public void activate()
Activate this source. At construct-time, the source is disabled.


isActive

public boolean isActive()
Test wether this source is active.

Returns:
active state.

getServer

public Server getServer()
Get the source server.

Returns:
the source server.

mayDefault

public boolean mayDefault()
Test whether this source may be used as a default source for system event output.

Returns:
true if this source may be used as a default source, false otherwise.