irc
Class MultiModeHandler

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

public class MultiModeHandler
extends java.lang.Object

Combined IRC mode handler.


Constructor Summary
MultiModeHandler(java.lang.String code, char[][] modes, char[] prefix)
          Create a new ModeHandler with empty mode.
 
Method Summary
 java.lang.String getMode()
          Get current mode to handle.
 java.lang.String getParameter()
          Get the current parameter, if defined.
 boolean hasParameter()
          Check whether the current mode has a parameter.
 boolean isModeA()
          Check wether the current mode comes from the A list.
 boolean isPrefix()
          Check wether the current mode comes from the prefix list instead of the A,B,C,D list.
 void next()
          Handle the next mode.
 boolean terminated()
          Check whether there is more modes to handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiModeHandler

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

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

terminated

public boolean terminated()
Check whether there is more modes to handle.

Returns:
true if there is more modes to handle, false otherwise.

next

public void next()
Handle the next mode. This method must be called before first call to any other getter's method.


getMode

public java.lang.String getMode()
Get current mode to handle.

Returns:
mode.

hasParameter

public boolean hasParameter()
Check whether the current mode has a parameter.

Returns:
true if the mode has a parameter, false otherwise.

getParameter

public java.lang.String getParameter()
Get the current parameter, if defined.

Returns:
the current parameter, if defined.

isPrefix

public boolean isPrefix()
Check wether the current mode comes from the prefix list instead of the A,B,C,D list.

Returns:
true if the mode is a prefix mode.

isModeA

public boolean isModeA()
Check wether the current mode comes from the A list.

Returns:
true if the mode is a A code.