com.zerjio.JIRC
Class MODEMessage

java.lang.Object
  extended bycom.zerjio.JIRC.IRCMessage
      extended bycom.zerjio.JIRC.MODEMessage

public class MODEMessage
extends IRCMessage

This class represents a MODE message that is send over an IRC Connection.

It is recommended to take a look to the RFC 1459 to know what this message means, its exact format and how to handle it.


Constructor Summary
MODEMessage(java.lang.String prefix, java.lang.String params)
          Constructs a MODE message with a prefix and its parameters.
 
Method Summary
 boolean affectsChannel()
          Returns if the mode msg affects a channel.
 boolean affectsUserInChannel()
          Returns if the mode msg affects to a user in a channel.
 boolean getB()
          Returns the new value for B.
 java.lang.String getBanMask()
          Gets the banMask that is affected by the MODE msg.
 boolean getChangeB()
          Returns if the B mode has chaged.
 boolean getChangeI()
          Returns if the I mode has chaged.
 boolean getChangeK()
          Returns if the K mode has chaged.
 boolean getChangeL()
          Returns if the L mode has chaged.
 boolean getChangeM()
          Returns if the M mode has chaged.
 boolean getChangeN()
          Returns if the N mode has chaged.
 boolean getChangeO()
          Returns if the O mode has chaged.
 boolean getChangeP()
          Returns if the P mode has chaged.
 boolean getChangeS()
          Returns if the S mode has chaged.
 boolean getChangeT()
          Returns if the T mode has chaged.
 boolean getChangeV()
          Returns if the V mode has chaged.
 boolean getI()
          Returns the new value for I.
 boolean getK()
          Returns the new value for K.
 java.lang.String getKey()
          Gets key of the channel.
 boolean getL()
          Returns the new value for L.
 int getLimit()
          Gets the number of users limit.
 boolean getM()
          Returns the new value for M.
 java.lang.String getModesString()
          Returns a String that represent the modes that have been changed.
 boolean getN()
          Returns the new value for N.
 boolean getO()
          Returns the new value for O.
 boolean getP()
          Returns the new value for P.
 java.lang.String getReceiverName()
          Gets the receiver Name that is affected by the MODE msg.
 boolean getS()
          Returns the new value for S.
 boolean getT()
          Returns the new value for T.
 java.lang.String getUser()
          Gets the user that is affected by the MODE msg.
 boolean getV()
          Returns the new value for V.
 java.lang.String whoChangesModes()
          Returns who changes the modes.
 
Methods inherited from class com.zerjio.JIRC.IRCMessage
asString, asStringWithoutPrefix, getCommand, getHost, getMustBeDiscarded, getNick, getParams, getPrefix, getUsedCount, isUsed, markAsUsed, mustBeDiscarded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MODEMessage

public MODEMessage(java.lang.String prefix,
                   java.lang.String params)
Constructs a MODE message with a prefix and its parameters. The command will be MODE.

Parameters:
prefix - The MODE message prefix.
params - The MODE message parameters.
Method Detail

getModesString

public java.lang.String getModesString()
Returns a String that represent the modes that have been changed.

Returns:
A String with the modes chaged.

getLimit

public int getLimit()
Gets the number of users limit. If there is no limit specified it will return -1

Returns:
The users limit or -1 if not specified.

getKey

public java.lang.String getKey()
Gets key of the channel. If there is no key specified it will return ""

Returns:
The channel key or "" if not specified.

getUser

public java.lang.String getUser()
Gets the user that is affected by the MODE msg. If there is no user specified it will return ""

Overrides:
getUser in class IRCMessage
Returns:
The user or "" if not specified.

getBanMask

public java.lang.String getBanMask()
Gets the banMask that is affected by the MODE msg. If there is no user specified it will return ""

Returns:
The banMask or "" if not specified.

getReceiverName

public java.lang.String getReceiverName()
Gets the receiver Name that is affected by the MODE msg. It can be a channel or the current user nick.

Returns:
The receiver name.

affectsChannel

public boolean affectsChannel()
Returns if the mode msg affects a channel.

Returns:
true if the msg affects to a channel (+|-ntilpskm) false otherwise

affectsUserInChannel

public boolean affectsUserInChannel()
Returns if the mode msg affects to a user in a channel.

Returns:
true if the msg affects to a user in a channel (+|-ovb)

getChangeN

public boolean getChangeN()
Returns if the N mode has chaged.

Returns:
true if the N mode has changed. false otherwise.

getN

public boolean getN()
Returns the new value for N. Only valid if getChangeN() returns true.

Returns:
The new value for the N mode.
See Also:
getChangeN()

getChangeT

public boolean getChangeT()
Returns if the T mode has chaged.

Returns:
true if the T mode has changed. false otherwise.

getT

public boolean getT()
Returns the new value for T. Only valid if getChangeT() returns true.

Returns:
The new value for the T mode.
See Also:
getChangeT()

getChangeI

public boolean getChangeI()
Returns if the I mode has chaged.

Returns:
true if the I mode has changed. false otherwise.

getI

public boolean getI()
Returns the new value for I. Only valid if getChangeI() returns true.

Returns:
The new value for the I mode.
See Also:
getChangeI()

getChangeL

public boolean getChangeL()
Returns if the L mode has chaged.

Returns:
true if the L mode has changed. false otherwise.

getL

public boolean getL()
Returns the new value for L. Only valid if getChangeL() returns true.

Returns:
The new value for the L mode.
See Also:
getChangeL()

getChangeP

public boolean getChangeP()
Returns if the P mode has chaged.

Returns:
true if the P mode has changed. false otherwise.

getP

public boolean getP()
Returns the new value for P. Only valid if getChangeP() returns true.

Returns:
The new value for the P mode.
See Also:
getChangeT()

getChangeS

public boolean getChangeS()
Returns if the S mode has chaged.

Returns:
true if the S mode has changed. false otherwise.

getS

public boolean getS()
Returns the new value for S. Only valid if getChangeS() returns true.

Returns:
The new value for the S mode.
See Also:
getChangeS()

getChangeK

public boolean getChangeK()
Returns if the K mode has chaged.

Returns:
true if the K mode has changed. false otherwise.

getK

public boolean getK()
Returns the new value for K. Only valid if getChangeK() returns true.

Returns:
The new value for the K mode.
See Also:
getChangeK()

getChangeM

public boolean getChangeM()
Returns if the M mode has chaged.

Returns:
true if the M mode has changed. false otherwise.

getM

public boolean getM()
Returns the new value for M. Only valid if getChangeM() returns true.

Returns:
The new value for the M mode.
See Also:
getChangeM()

getChangeO

public boolean getChangeO()
Returns if the O mode has chaged.

Returns:
true if the O mode has changed. false otherwise.

getO

public boolean getO()
Returns the new value for O. Only valid if getChangeO() returns true.

Returns:
The new value for the O mode.
See Also:
getChangeO()

getChangeV

public boolean getChangeV()
Returns if the V mode has chaged.

Returns:
true if the V mode has changed. false otherwise.

getV

public boolean getV()
Returns the new value for V. Only valid if getChangeV() returns true.

Returns:
The new value for the V mode.
See Also:
getChangeV()

getChangeB

public boolean getChangeB()
Returns if the B mode has chaged.

Returns:
true if the B mode has changed. false otherwise.

getB

public boolean getB()
Returns the new value for B. Only valid if getChangeB() returns true.

Returns:
The new value for the B mode.
See Also:
getChangeB()

whoChangesModes

public java.lang.String whoChangesModes()
Returns who changes the modes.

Returns:
Who changes the modes