f00f.net.irc.martyr.clientstate
Class ClientState
java.lang.Object
|
+--f00f.net.irc.martyr.clientstate.ClientState
- public class ClientState
- extends java.lang.Object
Maintains a list of client-related facts such as what channels we
are in, who else is in the channels, what our nick is, etc.
ClientState is a critical part of martyr. To get access to events
that change the client state, the framework user can subclass
ClientState and then pass the subclass to the IRCConnection's
constructor. Then, when a command detects a change in client
state, it will call the corresponding method in the custom
ClientState.
If a user of the framework wishes to grab client state information
about a channel (when a user joins, when a user leaves, topic
change, etc), the user can do so in a similar manner. Simply
override the 'addChannel(String)' method to instantiate their own
Channel subclass, and call the protected 'addChannel' method. See
the addChannel method for an example.
|
Field Summary |
protected java.util.Hashtable |
channels
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
channels
protected java.util.Hashtable channels
ClientState
public ClientState()
setNick
public void setNick(FullNick nick)
getNick
public FullNick getNick()
setUser
public void setUser(java.lang.String user)
setName
public void setName(java.lang.String name)
setServer
public void setServer(java.lang.String server)
getServer
public java.lang.String getServer()
setPort
public void setPort(int port)
getPort
public int getPort()
addChannel
public void addChannel(java.lang.String channame)
Adds a channel to the list of channels we know about. If you
want to supply your own Channel object, override this method
with:
public void addChannel( String channame )
{
addChannel( new MyChannel( channame ) );
}
addChannel
protected void addChannel(Channel channel)
getChannel
public Channel getChannel(java.lang.String chanName)
removeChannel
public void removeChannel(java.lang.String channel)
- Removes a channel from the state, does nothing if the channel name
is invalid.
Should we throw an exception here?
isOnChannel
public boolean isOnChannel(java.lang.String channel)
getChannelNames
public java.util.Enumeration getChannelNames()
getChannels
public java.util.Enumeration getChannels()
Copyright © 2000,2001,2002,2003 f00f networks.