|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
jirc.JIRC
public abstract class JIRC
JIRC is a easy way to implement irc functionality in your programs. Create an implementation, then use JIRC.start() to start the irc connection
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.io.BufferedReader |
sin
A variable holding System.in |
protected java.io.PrintStream |
sout
A variable holding System.out |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
JIRC(java.lang.String IRCServerName,
java.lang.String IRCNickName,
java.lang.String IRCRealName)
|
Method Summary | |
---|---|
void |
changeNick(java.lang.String nick)
Changes the current nickname of the connection |
void |
deOpChannelMember(java.lang.String channel,
java.lang.String name)
Removes operator status on the given channel member, assuming you have operator status |
Channel[] |
getChannelArray()
Gets an array version of the List of Channel objects used by JIRC |
java.util.List<Channel> |
getChannelList()
Gets the List of Channel objects used by JIRC |
java.lang.String |
getNick()
Gets the current nickname of the connection |
static int |
inChannelArray(Channel[] arr,
java.lang.String match)
|
static int |
inChannelList(java.util.List<Channel> list,
java.lang.String match)
|
void |
joinChannel(java.lang.String channel)
Joins the specified channel, allowing you to send and receive messages from it Note: channels are passed around sans-pound, so you would pass the channel "test", not the channel "#test" |
protected abstract void |
onChannelMemberJoin(java.lang.String channel,
java.lang.String nick)
|
protected abstract void |
onChannelMemberPart(java.lang.String channel,
java.lang.String nick)
|
protected abstract void |
onChannelMemberQuit(java.lang.String nick,
java.lang.String message)
|
protected abstract void |
onChannelMessageReceive(java.lang.String channel,
java.lang.String nick,
java.lang.String message)
|
protected abstract void |
onConnect()
|
protected abstract void |
onPingged(java.lang.String server)
|
protected abstract void |
onPrivateMessageReceive(java.lang.String nick,
java.lang.String message)
|
protected abstract void |
onServerMessage(java.lang.String message)
|
void |
opChannelMember(java.lang.String channel,
java.lang.String name)
Sets operator status on the given channel member, assuming you have operator status |
void |
partChannel(java.lang.String channel)
Parts the specified channel, meaning you can no longer get and receive messages from it Note: channels are passed around sans-pound, so you would pass the channel "test", not the channel "#test" |
void |
run()
|
void |
sendMessage(java.lang.String channel,
java.lang.String msg)
Sends a message to the specified channel Note: channels are passed around sans-pound, so you would pass the channel "test", not the channel "#test" |
void |
sendPrivateMessage(java.lang.String person,
java.lang.String msg)
Sends a message to the specified person |
void |
sendRawMessage(java.lang.String message)
Sends raw text to the server. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.io.PrintStream sout
protected java.io.BufferedReader sin
Constructor Detail |
---|
public JIRC(java.lang.String IRCServerName, java.lang.String IRCNickName, java.lang.String IRCRealName)
IRCServerName
- Name of the server to connect to (eg efnet.xs4all.nl or 127.0.0.1)IRCNickName
- Nick name to connect to the server withIRCRealName
- "Real" name to show tho the serverMethod Detail |
---|
protected abstract void onConnect()
protected abstract void onPingged(java.lang.String server)
protected abstract void onServerMessage(java.lang.String message)
protected abstract void onChannelMessageReceive(java.lang.String channel, java.lang.String nick, java.lang.String message)
protected abstract void onPrivateMessageReceive(java.lang.String nick, java.lang.String message)
protected abstract void onChannelMemberPart(java.lang.String channel, java.lang.String nick)
protected abstract void onChannelMemberJoin(java.lang.String channel, java.lang.String nick)
protected abstract void onChannelMemberQuit(java.lang.String nick, java.lang.String message)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void sendMessage(java.lang.String channel, java.lang.String msg)
channel
- The channel to send the message tomsg
- The message to sendpublic void sendRawMessage(java.lang.String message)
message
- the message to send (eg NICK newnick)public void sendPrivateMessage(java.lang.String person, java.lang.String msg)
person
- The person to send the message tomsg
- The message to sendpublic void joinChannel(java.lang.String channel)
channel
- The channel to joinpublic void partChannel(java.lang.String channel)
channel
- The channel to joinpublic void changeNick(java.lang.String nick)
nick
- What to change the nickname topublic java.lang.String getNick()
public void opChannelMember(java.lang.String channel, java.lang.String name)
channel
- The channel to change the person is inname
- The name of the person to give operator status topublic void deOpChannelMember(java.lang.String channel, java.lang.String name)
channel
- The channel to change the person is inname
- The name of the person to remove operator status frompublic Channel[] getChannelArray()
public java.util.List<Channel> getChannelList()
public static int inChannelList(java.util.List<Channel> list, java.lang.String match)
list
- match
-
public static int inChannelArray(Channel[] arr, java.lang.String match)
arr
- match
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |