org.schwering.irc.lib
public class IRCModeParser extends 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(String line)
Analyzes the modes and parses them into the parts operators (
+
or - ), modes (one character) and optional arguments (one
word or number). |
IRCModeParser(String modes,
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 |
---|---|
String |
getArgAt(int i)
Returns the nick of a given index.
|
int |
getCount()
Returns count of modes.
|
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. |
String |
toString()
Generates a
String with some information about the instance of
IRCModeParser . |
public IRCModeParser(String line)
+
or -
), modes (one character) and optional arguments (one
word or number).line
- The modes and the arguments; nothing more.public IRCModeParser(String modes, 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 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 String getLine()