|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.schwering.irc.lib.IRCUtil
Contains some utilities like numeric error and reply numbers.
The most description of the numeric errors and numeric replies are copied from RFC1459.
IRCConnection
,
IRCEventListener.onError(int, String)
,
IRCEventListener.onReply(int, String, String)
Field Summary | |
static char |
actionIndicator
Deprecated. Moved to IRCConstants . |
static char |
boldIndicator
Deprecated. Moved to IRCConstants . |
static char |
colorEndIndicator
Deprecated. Moved to IRCConstants . |
static char |
colorIndicator
Deprecated. Moved to IRCConstants . |
static char |
colorReverseIndicator
Deprecated. Moved to IRCConstants . |
static char |
underlinedIndicator
Deprecated. Moved to IRCConstants . |
Method Summary | |
static boolean |
isChan(java.lang.String str)
According to RFC2812 the channel's name may and must start with one of the following characters. |
static java.lang.String |
parseColors(java.lang.String str)
Erases the mIRC colorcodes from a String. |
static java.lang.StringBuffer |
parseColors(java.lang.StringBuffer buf)
Erases the mIRC colorcodes from a String. |
static int |
parseInt(java.lang.String str)
Parses a String to an int via
Integer.parseInt but avoids the
NumberFormatException . |
static java.lang.String[] |
split(java.lang.String str,
int delim)
Splits a string into substrings. |
static java.lang.String[] |
split(java.lang.String str,
int delim,
java.lang.String trailing)
Splits a string into substrings. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static char colorIndicator
IRCConstants
.
public static char boldIndicator
IRCConstants
.
public static char underlinedIndicator
IRCConstants
.
public static char colorEndIndicator
IRCConstants
.
public static char colorReverseIndicator
IRCConstants
.
public static char actionIndicator
IRCConstants
.
/me
).
Here it is as the ASCII decimal int 22.
Method Detail |
public static boolean isChan(java.lang.String str)
str
- The name to check if it's a channel.
true
if the argument starts with one of the characters
mentioned above.public static int parseInt(java.lang.String str)
String
to an int
via
Integer.parseInt
but avoids the
NumberFormatException
.
str
- The String
to parse.
int
. -1
if
NumberFormatException
was thrown.public static java.lang.String parseColors(java.lang.String str)
parseColors(StringBuffer)
method.
str
- The line which should be parsed.
parseColors(StringBuffer)
public static java.lang.StringBuffer parseColors(java.lang.StringBuffer buf)
buf
- The line which should be parsed.
StringBuffer
object which is cleaned from
any mIRC colorcodes.parseColors(String)
public static java.lang.String[] split(java.lang.String str, int delim, java.lang.String trailing)
str
- The string which is to split.delim
- The delimiter character, for example a space ' '
.trailing
- The ending which is added as a substring though it wasn't
in the str
. This parameter is just for the
IRCParser
class which uses this method to
split the middle
part into the parameters.
But as last parameter always the trailing
is
added. This is done here because it's the fastest way to
do it here. end
is null
or
""
, nothing is appended.
split(String, int)
public static java.lang.String[] split(java.lang.String str, int delim)
split(str, delim, null)
.
str
- The string which is to split.delim
- The delimiter character, for example a space ' '
.
split(String, int, String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |