de.berlios.suzy.irc
Class IrcTarget

java.lang.Object
  extended by de.berlios.suzy.irc.IrcTarget

public class IrcTarget
extends java.lang.Object

Specifies a target on irc. Typically this would be a channel or a user.

Author:
honk

Constructor Summary
IrcTarget(java.lang.String user, java.lang.String channel, boolean isPrivate)
          Creates a new Target with the given user and channel
 
Method Summary
 java.lang.String getChannel()
          the channel that is specified by this target, if any
 java.lang.String getDefaultTarget()
          This will return the appropriate method to contact the target specified by this instance.
 java.lang.String getUser()
          the user that is specified by this target
 boolean isPrivate()
          This method tells you if the user specified by this target expects a message in a channel or in private.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IrcTarget

public IrcTarget(java.lang.String user,
                 java.lang.String channel,
                 boolean isPrivate)
Creates a new Target with the given user and channel

Parameters:
user - the user that is specified by this target
channel - channel that is specified by this target, if any
isPrivate - whether or not the target is created from a user which expects text in a private message rather than a channel
Method Detail

isPrivate

public boolean isPrivate()
This method tells you if the user specified by this target expects a message in a channel or in private. Typically this will tell you if the user contacted us via a query in a channel.

Returns:
whether or not the user expects a private message or a channel wide message

getUser

public java.lang.String getUser()
the user that is specified by this target

Returns:
the user that is specified by this target

getChannel

public java.lang.String getChannel()
the channel that is specified by this target, if any

Returns:
the channel that is specified by this target, if any; null if no channel was specified

getDefaultTarget

public java.lang.String getDefaultTarget()
This will return the appropriate method to contact the target specified by this instance. Either a channel or a user.

Returns:
The contact point that the target specified by this instance expects