org.schwering.irc.lib
Class IRCUser

java.lang.Object
  extended by org.schwering.irc.lib.IRCUser

public class IRCUser
extends Object

Holds variables for the nick, username and host of a user.

It's used to pack these information in one object.

See Also:
IRCEventListener, IRCParser

Constructor Summary
IRCUser(String nick, String username, String host)
          Creates a new IRCUser object.
 
Method Summary
 String getHost()
          Returns the host of the person who sent the line.
 String getNick()
          Returns the nickname of the person who sent the line or the servername of the server which sent the line.
 String getServername()
          Returns the servername of the server which sent the line or the nickname of the person who sent the line.
 String getUsername()
          Returns the username of the person who sent the line.
 String toString()
          Returns the nickname.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IRCUser

public IRCUser(String nick,
               String username,
               String host)
Creates a new IRCUser object.

Parameters:
nick - The user's nickname.
username - The user's username.
host - The user's host.
Method Detail

getNick

public String getNick()
Returns the nickname of the person who sent the line or the servername of the server which sent the line.
If no nickname is given, null is returned.

Note: This method is totally equal to getServername!

Returns:
The nickname or the servername of the line. If no nick is given, null is returned.
See Also:
getServername(), getUsername(), getHost()

getServername

public String getServername()
Returns the servername of the server which sent the line or the nickname of the person who sent the line.
If no nickname is given, null is returned.

Note: This method is totally equal to getNick!

Returns:
The servername or the nickname of the line. If no server is given, null is returned.
See Also:
getNick()

getUsername

public String getUsername()
Returns the username of the person who sent the line.
If the username is not specified, this method returns null.

Returns:
The username of the line; null if it's not given.
See Also:
getNick(), getHost()

getHost

public String getHost()
Returns the host of the person who sent the line.
If the host is not specified, this method returns null.

Returns:
The host of the line; null if it's not given.
See Also:
getNick(), getUsername()

toString

public String toString()
Returns the nickname.

Overrides:
toString in class Object
Returns:
The nickname.