org.relayirc.chatengine
Class User

java.lang.Object
  |
  +--org.relayirc.chatengine.User
All Implemented Interfaces:
IChatObject, java.io.Serializable

public class User
extends java.lang.Object
implements IChatObject, java.io.Serializable

Represents the current user or a user who has been queried via WHOIS. Although this class claims to have property change support, listeners will only be notified when you call the onUpdateComplete method.

Version:
$Revision: 1.6.2.4 $

The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL

Original Code: Relay IRC Chat Engine
Initial Developer: David M. Johnson
Contributor(s): No contributors to this file

Copyright (C) 1997-2000 by David M. Johnson
All Rights Reserved.
Author:
David M. Johnson
See Also:
Serialized Form

Constructor Summary
User(java.lang.String nick)
          Construct user object for user specified by nick.
User(java.lang.String nick, java.lang.String altNick, java.lang.String userName, java.lang.String fullName)
          Construct user object for user specified by nick.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Property change support.
 boolean equals(java.lang.Object obj)
          User objects are equal if they have the same nick name.
 java.lang.String getAltNick()
          Get user's alternate nickname, only valid for current user.
 java.lang.String getChannels()
          Get list of user's channels as reported by last WHOIS reply.
 java.lang.String getDescription()
          Get current user's comments on this user.
 java.lang.String getFullName()
          Get user's full-name.
 java.lang.String getHostName()
          Get name of computer on which user's client is running.
 int getIdleTime()
          Get user's idle time as reported by last WHOIS reply.
 java.lang.String getName()
          Get user's IRC handle (same as nick).
 java.lang.String getNick()
          Get user's IRC handle.
 java.lang.String getServerDesc()
          Get description of user's server as reported by last WHOIS reply.
 java.lang.String getServerName()
          Get name of IRC server user is using.
 java.util.Date getSignonTime()
          Get user's signon time as reported by last WHOIS reply.
 java.util.Date getUpdateTime()
          Get time of last WHOIS reply.
 java.lang.String getUserName()
          Get login name reported to IRC by user's ident daemon.
 boolean isOnline()
          Get user's online status (TODO!)
 void onUpdateComplete()
          Notify listeners that user has been updated.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Property change support.
 void setAltNick(java.lang.String altnick)
          Set user's alternate nickname, only valid for current user.
 void setChannels(java.lang.String channels)
          Set list of user's channels as reported by last WHOIS reply.
 void setDescription(java.lang.String desc)
          Set current user's comments on this user.
 void setFullName(java.lang.String fullName)
          Set user's full-name.
 void setHostName(java.lang.String hostName)
          Set name of computer on which user's client is running.
 void setIdleTime(int idleTime)
          Set user's idle time as reported by last WHOIS reply.
 void setName(java.lang.String nick)
          Set user's IRC handle (same as nick).
 void setNick(java.lang.String nick)
          Set user's IRC handle.
 void setOnline(boolean isOnline)
          Set user's online status (TODO!)
 void setServerDesc(java.lang.String serverDesc)
          Set description of user's server as reported by last WHOIS reply.
 void setServerName(java.lang.String serverName)
          Set name of IRC server user is using.
 void setSignonTime(java.util.Date signonTime)
          Set user's signon time as reported by last WHOIS reply.
 void setUpdateTime(java.util.Date updateTime)
          Set time of last WHOIS reply.
 void setUserName(java.lang.String userName)
          Set login name reported to IRC by user's ident daemon.
 java.lang.String toDescription()
          Creates detailed multi-line description of user.
 java.lang.String toString()
          Return string representation of user for display purpses.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String nick)
Construct user object for user specified by nick.

User

public User(java.lang.String nick,
            java.lang.String altNick,
            java.lang.String userName,
            java.lang.String fullName)
Construct user object for user specified by nick.
Method Detail

equals

public boolean equals(java.lang.Object obj)
User objects are equal if they have the same nick name.
Overrides:
equals in class java.lang.Object

onUpdateComplete

public void onUpdateComplete()
Notify listeners that user has been updated.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Property change support.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Property change support.

getDescription

public java.lang.String getDescription()
Get current user's comments on this user.
Specified by:
getDescription in interface IChatObject

setDescription

public void setDescription(java.lang.String desc)
Set current user's comments on this user.
Specified by:
setDescription in interface IChatObject

getAltNick

public java.lang.String getAltNick()
Get user's alternate nickname, only valid for current user.

setAltNick

public void setAltNick(java.lang.String altnick)
Set user's alternate nickname, only valid for current user.

getNick

public java.lang.String getNick()
Get user's IRC handle.

setNick

public void setNick(java.lang.String nick)
Set user's IRC handle.

getName

public java.lang.String getName()
Get user's IRC handle (same as nick).

setName

public void setName(java.lang.String nick)
Set user's IRC handle (same as nick).

getUserName

public java.lang.String getUserName()
Get login name reported to IRC by user's ident daemon.

setUserName

public void setUserName(java.lang.String userName)
Set login name reported to IRC by user's ident daemon.

getFullName

public java.lang.String getFullName()
Get user's full-name.

setFullName

public void setFullName(java.lang.String fullName)
Set user's full-name.

getHostName

public java.lang.String getHostName()
Get name of computer on which user's client is running.

setHostName

public void setHostName(java.lang.String hostName)
Set name of computer on which user's client is running.

getServerName

public java.lang.String getServerName()
Get name of IRC server user is using.

setServerName

public void setServerName(java.lang.String serverName)
Set name of IRC server user is using.

getServerDesc

public java.lang.String getServerDesc()
Get description of user's server as reported by last WHOIS reply.

setServerDesc

public void setServerDesc(java.lang.String serverDesc)
Set description of user's server as reported by last WHOIS reply.

getChannels

public java.lang.String getChannels()
Get list of user's channels as reported by last WHOIS reply.

setChannels

public void setChannels(java.lang.String channels)
Set list of user's channels as reported by last WHOIS reply.

isOnline

public boolean isOnline()
Get user's online status (TODO!)

setOnline

public void setOnline(boolean isOnline)
Set user's online status (TODO!)

getIdleTime

public int getIdleTime()
Get user's idle time as reported by last WHOIS reply.

setIdleTime

public void setIdleTime(int idleTime)
Set user's idle time as reported by last WHOIS reply.

getSignonTime

public java.util.Date getSignonTime()
Get user's signon time as reported by last WHOIS reply.

setSignonTime

public void setSignonTime(java.util.Date signonTime)
Set user's signon time as reported by last WHOIS reply.

getUpdateTime

public java.util.Date getUpdateTime()
Get time of last WHOIS reply.

setUpdateTime

public void setUpdateTime(java.util.Date updateTime)
Set time of last WHOIS reply.

toString

public java.lang.String toString()
Return string representation of user for display purpses.
Overrides:
toString in class java.lang.Object

toDescription

public java.lang.String toDescription()
Creates detailed multi-line description of user. JDK 1.1 compatible thanks to Mark Gent.