|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object f00f.net.irc.martyr.clientstate.Channel
public class Channel
Channel is simply a repository for information about a channel. Contains channel name, topic, who created the topic, when the topic was created, who is in the channel, mode, etc.
If a user of the framework wishes to use their own Member object (to trap events like setting/removing ops), then subclass Channel and add a method as follows.
public Member makeMember( String member ) { return MyMemberSubClass( member ) ); }
Each of the methods in Channel that need to create a Member object (many are just temporary members, for the enhanced 'equals') calls makeMember instead of new Member(...). That is why this version of addMember is protected, so that a part of the framework won't do something silly like:
... channel.addMember( new Member( member ) ); ...
Constructor Summary | |
---|---|
Channel(java.lang.String chanName)
|
Method Summary | |
---|---|
void |
addMember(FullNick nick,
Command why)
Deprecated. Use addMember( FullNick, InCommand ) intead. |
void |
addMember(FullNick nick,
InCommand why)
|
protected void |
addMember(Member member)
|
void |
addMember(java.lang.String member,
Command why)
Deprecated. Use addMember( String, InCommand )
instead. |
void |
addMember(java.lang.String member,
InCommand why)
Adds the member to the channel. |
static boolean |
areEqual(java.lang.String one,
java.lang.String two)
Compares the two channel names for equality. |
protected Member |
findMember(Member member)
|
Member |
findMember(java.lang.String nick)
Finds the Member object associated with a specific nick. |
java.util.Date |
getCreationDate()
|
java.util.Enumeration |
getMembers()
Returns an enumeration of Member objects, in no particular order. |
java.util.Iterator |
getModes()
|
java.lang.String |
getName()
|
java.lang.String |
getTopic()
|
java.lang.String |
getTopicAuthor()
|
java.util.Date |
getTopicDate()
|
static boolean |
isChannel(java.lang.String str)
Determines if the string represents a channel name or not. |
protected boolean |
isMemberInChannel(Member member)
Determines if the member is in this channel. |
boolean |
isMemberInChannel(java.lang.String nick)
Determines if the nick is in the channel. |
protected Member |
makeMember(java.lang.String nick)
To use a customized Member class, override this. |
void |
removeMember(FullNick member,
Command why)
Deprecated. Use removeMember( FullNick, InCommand ) instead. |
void |
removeMember(FullNick nick,
InCommand why)
Simply a wrapper to allow FullNicks to be used. |
protected void |
removeMember(Member compareTo)
|
void |
removeMember(java.lang.String member,
Command why)
Deprecated. Use removeMember( String, InCommand ) instead. |
void |
removeMember(java.lang.String member,
InCommand why)
Removes the user from the channel. |
void |
setCreationDate(java.util.Date date)
|
void |
setMode(Mode mode)
Informs the channel of a mode change. |
void |
setTopic(java.lang.String topic)
|
void |
setTopicAuthor(java.lang.String author)
|
void |
setTopicDate(java.util.Date date)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Channel(java.lang.String chanName)
Method Detail |
---|
public java.lang.String getName()
protected void addMember(Member member)
public void addMember(java.lang.String member, Command why)
addMember( String, InCommand )
instead.
member
- Member to add to the channelwhy
- Command that caused the member to be addedpublic void addMember(java.lang.String member, InCommand why)
member
- Nick to add to the channelwhy
- Command that caused the member to be addedpublic void addMember(FullNick nick, Command why)
addMember( FullNick, InCommand )
intead.
nick
- Nick to add to the channelwhy
- Command that caused the member to be addedpublic void addMember(FullNick nick, InCommand why)
nick
- Nick to add to the channelwhy
- Command that caused the member to be added
Adds the member to the channel. Just calls nick.getNick().public void removeMember(java.lang.String member, InCommand why)
member
- Nick of the person leaving.why
- Command issed that caused this action.public void removeMember(java.lang.String member, Command why)
removeMember( String, InCommand ) instead.
member
- Nick to remove from channelwhy
- Command that caused removalpublic void removeMember(FullNick member, Command why)
removeMember( FullNick, InCommand ) instead.
member
- Member to remove from channelwhy
- Command that caused removalpublic void removeMember(FullNick nick, InCommand why)
nick
- Nick to remove from channelwhy
- Command that caused removalprotected void removeMember(Member compareTo)
public void setMode(Mode mode)
mode
- Mode to set on the channelpublic java.util.Iterator getModes()
public java.util.Enumeration getMembers()
public boolean isMemberInChannel(java.lang.String nick)
nick
- Nick of member to check
protected boolean isMemberInChannel(Member member)
member
- Member to check
public Member findMember(java.lang.String nick)
nick
- Nick to check whether it's a member of the channel or not
protected Member findMember(Member member)
public void setTopic(java.lang.String topic)
public java.lang.String getTopic()
public java.util.Date getTopicDate()
public void setTopicDate(java.util.Date date)
public java.util.Date getCreationDate()
public void setCreationDate(java.util.Date date)
public java.lang.String getTopicAuthor()
public void setTopicAuthor(java.lang.String author)
protected Member makeMember(java.lang.String nick)
nick
- Nickname to create a member object for
public static boolean isChannel(java.lang.String str)
str
- String to test if it's a channel or not
public static boolean areEqual(java.lang.String one, java.lang.String two)
one
- Left side of comparisontwo
- Right side of comparison
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |