irc
Class ModeHandler

java.lang.Object
  |
  +--irc.ModeHandler

public class ModeHandler
extends java.lang.Object

IRC mode handler.


Constructor Summary
ModeHandler(char[][] modes, char[] prefix)
          Create a new ModeHandler with empty mode.
ModeHandler(java.lang.String mode, char[][] modes, char[] prefix)
          Create a new ModeHandler with given mode.
 
Method Summary
 void apply(java.lang.String mode)
          Apply a new mode on the current mode.
 int getLimit()
          Get user limit (+l), if defined.
 java.lang.String getMode()
          Get a string representation of the current mode.
 java.lang.String getPassword()
          Get password (+k), if defined.
 boolean hasMode(char mode)
          Test wether the given mode is set.
 void reset()
          Reset current mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModeHandler

public ModeHandler(char[][] modes,
                   char[] prefix)
Create a new ModeHandler with empty mode.

Parameters:
modes - A,B,C,D known modes. This is an array of four arrays of chars.
prefix - prefix modes.

ModeHandler

public ModeHandler(java.lang.String mode,
                   char[][] modes,
                   char[] prefix)
Create a new ModeHandler with given mode.

Parameters:
mode - initial mode.
modes - A,B,C,D know modes.
prefix - prefix modes.
Method Detail

reset

public void reset()
Reset current mode.


getPassword

public java.lang.String getPassword()
Get password (+k), if defined.


getLimit

public int getLimit()
Get user limit (+l), if defined.


apply

public void apply(java.lang.String mode)
Apply a new mode on the current mode.

Parameters:
mode - new mode to apply.

hasMode

public boolean hasMode(char mode)
Test wether the given mode is set.

Parameters:
mode - mode to test.

getMode

public java.lang.String getMode()
Get a string representation of the current mode.