Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.relayirc.chatengine
Class Channel  view Channel download Channel.java

java.lang.Object
  extended byorg.relayirc.chatengine.Channel
All Implemented Interfaces:
java.io.Serializable

public class Channel
extends java.lang.Object
implements java.io.Serializable

An IRC channel class that includes methods for joining, parting, kicking, banning, adding/removing channel listeners and property change support.


Nested Class Summary
(package private) static interface Channel._ChannelEventNotifier
           
private  class Channel._ChannelMux
           
 
Field Summary
private  IChatEngine _engine
           
private  boolean _isConnected
           
private  java.util.Vector _listeners
           
private  Channel._ChannelMux _mux
          For internal chat engine use only.
private  java.lang.String _name
           
private  java.beans.PropertyChangeSupport _propChangeSupport
           
private  java.lang.String _topic
           
private  int _userCount
           
(package private) static long serialVersionUID
           
 
Constructor Summary
Channel(java.lang.String name)
          Construct channel with name alone.
Channel(java.lang.String name, IChatEngine engine)
          Construct channel with chat engine.
Channel(java.lang.String name, java.lang.String topic, int ucount, IChatEngine engine)
          Channel with name, topic, user count and a chat engine.
 
Method Summary
 void activate()
          Request that this channel be activated, given-focus or brought-to-front.
 void addChannelListener(ChannelListener listener)
          Channel listener support.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Property change support.
 void connect()
          Connect/join this channel, does nothing if channel has no chat engine.
 void disconnect()
          Disconnect/part this channel, does nothing if channel has no chat engine.
(package private)  IRCConnectionListener getChannelMux()
          Get channel's IRCConnectionListener, for internal use only.
 IChatEngine getChatEngine()
          Get the channel's chat engine, which may be null.
 java.lang.String getName()
          Get name of channel (e.g.
 java.lang.String getTopic()
          Get channe's topic.
 int getUserCount()
          Number of users currently on channel.
 boolean isConnected()
          True if channel is connected/joined.
private  void notifyListeners(Channel._ChannelEventNotifier notifier)
           
private  void readObject(java.io.ObjectInputStream in)
           
 void removeChannelListener(ChannelListener listener)
          Channel listener support.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Property change support.
 void sendAction(java.lang.String msg)
          Send an action to this channel.
 void sendBan(java.lang.String nick)
          Ban a user from this channel.
 void sendCommand(java.lang.String cmd)
          Send an arbitrary command to the chat server.
 void sendDeop(java.lang.String nick)
          Take operator rights from a user.
 void sendJoin()
          Join this channel, requires a chat engine.
 void sendKick(java.lang.String nick)
          Kick a user from the channel.
 void sendMessage(java.lang.String str)
          Deprecated. Use Channel.privMsg() instead.
 void sendOp(java.lang.String nick)
          Give operator rights to a user.
 void sendPart()
          Part (leave) this channel.
 void sendVersion(java.lang.String nick)
          Request version information for a user.
 void setChatEngine(IChatEngine engine)
          Set the chat engine to be used by this view.
 void setConnected(boolean value)
          Set connection status.
 void setName(java.lang.String name)
          Set channel name, with property change support.
 void setTopic(java.lang.String topic)
          Set channel topic, with property change support.
 void setUserCount(int count)
          Set channel user count, with property change support.
 java.lang.String toString()
          String representation is channel name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_engine

private transient IChatEngine _engine

_listeners

private transient java.util.Vector _listeners

_isConnected

private transient boolean _isConnected

_name

private java.lang.String _name

_topic

private java.lang.String _topic

_userCount

private int _userCount

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

_propChangeSupport

private java.beans.PropertyChangeSupport _propChangeSupport

_mux

private Channel._ChannelMux _mux
For internal chat engine use only.

Constructor Detail

Channel

public Channel(java.lang.String name)
Construct channel with name alone.


Channel

public Channel(java.lang.String name,
               IChatEngine engine)
Construct channel with chat engine.


Channel

public Channel(java.lang.String name,
               java.lang.String topic,
               int ucount,
               IChatEngine engine)
Channel with name, topic, user count and a chat engine.

Method Detail

notifyListeners

private void notifyListeners(Channel._ChannelEventNotifier notifier)

addChannelListener

public void addChannelListener(ChannelListener listener)
Channel listener support.


removeChannelListener

public void removeChannelListener(ChannelListener listener)
Channel listener support.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Property change support.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Property change support.


isConnected

public boolean isConnected()
True if channel is connected/joined.


setConnected

public void setConnected(boolean value)
Set connection status.


getChatEngine

public IChatEngine getChatEngine()
Get the channel's chat engine, which may be null.


getChannelMux

IRCConnectionListener getChannelMux()
Get channel's IRCConnectionListener, for internal use only.


connect

public void connect()
Connect/join this channel, does nothing if channel has no chat engine.


disconnect

public void disconnect()
Disconnect/part this channel, does nothing if channel has no chat engine.


getName

public java.lang.String getName()
Get name of channel (e.g. "#java" or "#raleigh"


setChatEngine

public void setChatEngine(IChatEngine engine)
Set the chat engine to be used by this view. And: use that chat engine to create a new chat view for this channel.


setName

public void setName(java.lang.String name)
Set channel name, with property change support. Property change event will include new and old values.


getTopic

public java.lang.String getTopic()
Get channe's topic.


setTopic

public void setTopic(java.lang.String topic)
Set channel topic, with property change support. Property change event will include new and old values.


getUserCount

public int getUserCount()
Number of users currently on channel.


setUserCount

public void setUserCount(int count)
Set channel user count, with property change support. Property change event will include new and old values as java.lang.Integer objects.


toString

public java.lang.String toString()
String representation is channel name.


activate

public void activate()
Request that this channel be activated, given-focus or brought-to-front.


readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException

sendAction

public void sendAction(java.lang.String msg)
Send an action to this channel.


sendBan

public void sendBan(java.lang.String nick)
Ban a user from this channel.


sendCommand

public void sendCommand(java.lang.String cmd)
Send an arbitrary command to the chat server.


sendDeop

public void sendDeop(java.lang.String nick)
Take operator rights from a user.


sendJoin

public void sendJoin()
Join this channel, requires a chat engine. Before you call this method, make sure you have set the chat engine for this channel.


sendKick

public void sendKick(java.lang.String nick)
Kick a user from the channel.


sendMessage

public void sendMessage(java.lang.String str)
Deprecated. Use Channel.privMsg() instead.

Send private message to server.


sendOp

public void sendOp(java.lang.String nick)
Give operator rights to a user.


sendPart

public void sendPart()
Part (leave) this channel.


sendVersion

public void sendVersion(java.lang.String nick)
Request version information for a user.