wtanaka.praya
Class Status

java.lang.Object
  |
  +--wtanaka.praya.Status

public class Status
extends java.lang.Object

The status of a recipient.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2001/10/14 18:07:13 $
Author:
$Author: wtanaka $

Field Summary
static java.lang.String AVAILABLE
          Named constant for representing a user that is online and available.
static Status AVAILABLE_STATUS
          special named constant for available status
static java.lang.String AWAY
          Named constant for representing a user that is online but not available (away, busy, etc)
static Status BRB_STATUS
          special named constant for be right back status, used by Yahoo, MSN
static Status BUSY_STATUS
          special named constant for busy status, used by Yahoo, MSN
static Status IDLE_STATUS
          special named constant for idle status
private  double m_availabilityLevel
          How available they are (0.0 = not, 1.0 = are)
private  java.lang.String m_statusString
          Textual description of the person's availability ("away," "available," etc.
static Status NOT_AT_DESK_STATUS
          special named constant for not at my desk status, used by Yahoo
static Status NOT_AT_HOME_STATUS
          special named constant for not at home status, used by Yahoo
static Status NOT_IN_OFFICE_STATUS
          special named constant for not in the office status, used by Yahoo
static java.lang.String OFFLINE
          Named constant for representing a user that is offline.
static Status ON_PHONE_STATUS
          special named constant for on the phone status, used by Yahoo, MSN
static Status ON_VACATION_STATUS
          special named constant for on vacation status, used by Yahoo
static Status OUT_TO_LUNCH_STATUS
          special named constant for out to lunch status, used by Yahoo, MSN
static Status STEPPED_OUT_STATUS
          special named constant for on vacation status, used by Yahoo
 
Constructor Summary
Status(double availability, java.lang.String statusString)
          Constructor
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getDescription()
          Returns either AVAILABLE, OFFLINE or AWAY
 java.lang.String getStatusString()
          Returns a more descriptive status string for the user.
 int hashCode()
           
 boolean isOffline()
           
 boolean isOnline()
           
 java.lang.String toString()
          Unfortunately, IBM JDK 1.3.0 on linux uses this method to determine if a change should be made to a JComboBox that has these objects in its model.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

AVAILABLE

public static final java.lang.String AVAILABLE
Named constant for representing a user that is online and available.

AWAY

public static final java.lang.String AWAY
Named constant for representing a user that is online but not available (away, busy, etc)

OFFLINE

public static final java.lang.String OFFLINE
Named constant for representing a user that is offline.

IDLE_STATUS

public static final Status IDLE_STATUS
special named constant for idle status

AVAILABLE_STATUS

public static final Status AVAILABLE_STATUS
special named constant for available status

BUSY_STATUS

public static final Status BUSY_STATUS
special named constant for busy status, used by Yahoo, MSN

BRB_STATUS

public static final Status BRB_STATUS
special named constant for be right back status, used by Yahoo, MSN

NOT_AT_HOME_STATUS

public static final Status NOT_AT_HOME_STATUS
special named constant for not at home status, used by Yahoo

NOT_IN_OFFICE_STATUS

public static final Status NOT_IN_OFFICE_STATUS
special named constant for not in the office status, used by Yahoo

NOT_AT_DESK_STATUS

public static final Status NOT_AT_DESK_STATUS
special named constant for not at my desk status, used by Yahoo

ON_PHONE_STATUS

public static final Status ON_PHONE_STATUS
special named constant for on the phone status, used by Yahoo, MSN

ON_VACATION_STATUS

public static final Status ON_VACATION_STATUS
special named constant for on vacation status, used by Yahoo

OUT_TO_LUNCH_STATUS

public static final Status OUT_TO_LUNCH_STATUS
special named constant for out to lunch status, used by Yahoo, MSN

STEPPED_OUT_STATUS

public static final Status STEPPED_OUT_STATUS
special named constant for on vacation status, used by Yahoo

m_availabilityLevel

private double m_availabilityLevel
How available they are (0.0 = not, 1.0 = are)

m_statusString

private java.lang.String m_statusString
Textual description of the person's availability ("away," "available," etc.
Constructor Detail

Status

public Status(double availability,
              java.lang.String statusString)
Constructor
Parameters:
availability - the availability between 0.0 and 1.0 inclusive
statusString - a descriptive string representing the status.
Method Detail

getDescription

public java.lang.String getDescription()
Returns either AVAILABLE, OFFLINE or AWAY
See Also:
AVAILABLE, OFFLINE, AWAY

getStatusString

public java.lang.String getStatusString()
Returns a more descriptive status string for the user.

isOnline

public boolean isOnline()

isOffline

public boolean isOffline()

toString

public java.lang.String toString()
Unfortunately, IBM JDK 1.3.0 on linux uses this method to determine if a change should be made to a JComboBox that has these objects in its model. So we need to ensure that \forall a, b where a instanceof Status and b instanceof Status : !a.equals(b) => !a.toString().equals(b.toString())
Overrides:
toString in class java.lang.Object
Returns:
a string unique to this particular status value.

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object