public class PresenceStatus extends java.lang.Object implements java.lang.Comparable<PresenceStatus>
Modifier and Type | Field and Description |
---|---|
static int |
AVAILABLE_THRESHOLD
An integer above which all values of the status coefficient indicate both
connectivity and availability.
|
static int |
AWAY_THRESHOLD
An integer above which all values of the status coefficient indicate both
connectivity and availability but the person is away from the computer.
|
static int |
EAGER_TO_COMMUNICATE_THRESHOLD
An integer above which all values of the status coefficient indicate
eagerness to communicate
|
static int |
EXTENDED_AWAY_THRESHOLD
An integer above which all values of the status coefficient indicate both
connectivity and availability but the person is away from the computer.
|
static int |
MAX_STATUS_VALUE
An integer indicating the maximum possible value of the status field.
|
static int |
ONLINE_THRESHOLD
An integer above which all values of the status coefficient indicate that
a status with connectivity (communication is possible).
|
protected int |
status
Represents the connectivity status on a scale from 0 to 100 with 0
indicating complete disability for communication and 100 maximum ability
and user willingness.
|
protected byte[] |
statusIcon
An image that graphically represents the status.
|
protected java.lang.String |
statusName
The name of this status instance (e.g.
|
Modifier | Constructor and Description |
---|---|
protected |
PresenceStatus(int status,
java.lang.String statusName)
Creates an instance of this class using the specified parameters.
|
protected |
PresenceStatus(int status,
java.lang.String statusName,
byte[] statusIcon)
Creates an instance of this class using the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PresenceStatus target)
Compares this instance with the specified object for order.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
int |
getStatus()
Returns an integer representing the presence status on a scale from 0 to
100.
|
byte[] |
getStatusIcon()
Returns an image that graphically represents the status.
|
java.lang.String |
getStatusName()
Returns the name of this status (such as Away, On-line, Invisible, etc).
|
int |
hashCode()
Returns a hash code value for the object.
|
boolean |
isAvailable()
Indicates whether the user is both Online and avaliable (can be reached
and is likely to respond) or not.
|
boolean |
isEagerToCommunicate()
Indicates whether the user is Online, available and eager to communicate
(can be reached and is likely to become annoyingly talkative if
contacted).
|
boolean |
isOnline()
Indicates whether the user is Online (can be reached) or not.
|
java.lang.String |
toString()
Returns a string representation of this provider status.
|
public static final int ONLINE_THRESHOLD
public static final int EXTENDED_AWAY_THRESHOLD
public static final int AWAY_THRESHOLD
public static final int AVAILABLE_THRESHOLD
public static final int EAGER_TO_COMMUNICATE_THRESHOLD
public static final int MAX_STATUS_VALUE
protected final byte[] statusIcon
protected final int status
protected final java.lang.String statusName
protected PresenceStatus(int status, java.lang.String statusName)
status
- the status variable representing the new instancestatusName
- the name of this PresenceStatusprotected PresenceStatus(int status, java.lang.String statusName, byte[] statusIcon)
status
- the status variable representing the new instancestatusName
- the name of this PresenceStatusstatusIcon
- an image that graphically represents the status or null
if no such image is available.public int getStatus()
public java.lang.String getStatusName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isOnline()
public boolean isAvailable()
public boolean isEagerToCommunicate()
public int compareTo(PresenceStatus target) throws java.lang.ClassCastException, java.lang.NullPointerException
compareTo
in interface java.lang.Comparable<PresenceStatus>
target
- the PresenceStatus
to be compared.java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this Object.java.lang.NullPointerException
- if o is nullpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.obj
argument; false otherwise.public int hashCode()
hashCode
in class java.lang.Object
public byte[] getStatusIcon()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.