f00f.net.irc.martyr
Interface Mode

All Known Implementing Classes:
AnonChannelMode, BanMode, ExceptionMode, GenericChannelMask, GenericChannelMode, GenericMode, GenericUserMode, InvisibleMode, InviteMaskMode, InviteOnlyMode, KeyMode, LimitMode, ModeratedMode, NoExtMsgMode, OperMode, PrivateMode, SecretMode, TopicLockMode, VoiceMode

public interface Mode

Any class which is to represent a mode must implement this interface. They must also implement equals(...) so that if the parameter for either mode is null they are equal based on the character, and if both parameters are not null, base the equal on the character and the parameters being equal.


Nested Class Summary
static class Mode.Sign
          Finally, the Sign enumeration.
 
Method Summary
 char getChar()
          The character that represents this mode (ie o for operator)
 java.lang.String getParam()
          Returns the parameter that was set with setParam(...)
 Mode.Sign getSign()
           
 Mode newInstance()
          A Mode can be constructed and asked to make copies of itself.
 boolean onePerChannel()
          Determines if there can be multiple versions of this mode in the channel.
 boolean recordInChannel()
          This mode should be recorded in the list of channel modes.
 boolean requiresParam()
          Should return true if this mode requires a parameter.
 void setParam(java.lang.String str)
          Sets the parameter that can be retrieved with getParam()
 void setSign(Mode.Sign sign)
          Sets the sign of the operation.
 

Method Detail

newInstance

Mode newInstance()
A Mode can be constructed and asked to make copies of itself.

Returns:
New Mode instance

getChar

char getChar()
The character that represents this mode (ie o for operator)

Returns:
Character representation of mode

requiresParam

boolean requiresParam()
Should return true if this mode requires a parameter.

Returns:
True or false if a param is required for mode

recordInChannel

boolean recordInChannel()
This mode should be recorded in the list of channel modes. This would NOT include such things as operator status, as it is recored with the Member object.

Returns:
True or false of the mode should be recorded in the list of channels

onePerChannel

boolean onePerChannel()
Determines if there can be multiple versions of this mode in the channel.

Returns:
True or false if only one instance of mode can exist per channel

getParam

java.lang.String getParam()
Returns the parameter that was set with setParam(...)

Returns:
Parameter that was set previously

setParam

void setParam(java.lang.String str)
Sets the parameter that can be retrieved with getParam()

Parameters:
str - Parameter to set on mode

setSign

void setSign(Mode.Sign sign)
Sets the sign of the operation. Must be positive (granting), negative (revoking) or nosign (neutral operation).

Parameters:
sign - Sign (+/-) of the mode

getSign

Mode.Sign getSign()
Returns:
the sign of this mode.


Copyright © 2000-2007 Ben Damm, Daniel Henninger, et al.