public class IRCModeParser
extends java.lang.Object
An instance of this class is an argument of the
.
It's intended to help the programmer to work with the modes.
IRCEventListener.onMode(String chan, IRCUser user,
IRCModeParser modeParser)
Channelmodes are:
These are all channel-modes defined in RFC1459. Nevertheless, most networks provide more channel-modes. This class can handle all modes; it's not restricted to the rights defined in RFC1459.
IRCEventListener
Constructor and Description |
---|
IRCModeParser(java.lang.String line)
Analyzes the modes and parses them into the parts operators (
+
or - ), modes (one character) and optional arguments (one
word or number). |
IRCModeParser(java.lang.String modes,
java.lang.String args)
Analyzes the modes and parses them into the parts operators (
+
or - ), modes (one character) and optional arguments (one
word or number). |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getArgAt(int i)
Returns the nick of a given index.
|
int |
getCount()
Returns count of modes.
|
java.lang.String |
getLine()
Returns the line as it was sent from the IRC server.
|
char |
getModeAt(int i)
Returns the mode (for example
o , v ,
m , i ) of a given index. |
char |
getOperatorAt(int i)
Returns the operator (
+ or - ) of a given index. |
java.lang.String |
toString()
Generates a
String with some information about the instance of
IRCModeParser . |
public IRCModeParser(java.lang.String line)
+
or -
), modes (one character) and optional arguments (one
word or number).line
- The modes and the arguments; nothing more.public IRCModeParser(java.lang.String modes, java.lang.String args)
+
or -
), modes (one character) and optional arguments (one
word or number).modes
- The modes (for example +oo+m-v
).args
- The modes' arguments (for example Heinz Hans
Thomas
).public int getCount()
getOperatorAt(int)
,
getModeAt(int)
,
getArgAt(int)
public char getOperatorAt(int i)
+
or -
) of a given index.i
- The index of the operator you want to get. The index starts
with 1
and not with 0
.+
or -
).getCount()
,
getModeAt(int)
,
getArgAt(int)
public char getModeAt(int i)
o
, v
,
m
, i
) of a given index.i
- The index of the mode you want to get. The index starts with
1
and not with 0
.o
,
v
, m
, i
)getCount()
,
getOperatorAt(int)
,
getArgAt(int)
public java.lang.String getArgAt(int i)
i
- The index of the argument you want to get. The index starts with
1
and not with 0
.""
if there's no
argument at this index (for example +m
for moderated
has never an argument).getCount()
,
getOperatorAt(int)
,
getModeAt(int)
public java.lang.String getLine()
public java.lang.String toString()
String
with some information about the instance of
IRCModeParser
.
Its format is: classname[line]
.toString
in class java.lang.Object
String
with information about the instance.