net.sourceforge.simpleaim
Class Buddy

java.lang.Object
  |
  +--net.sourceforge.simpleaim.Buddy
All Implemented Interfaces:
java.lang.Comparable

public class Buddy
extends java.lang.Object
implements java.lang.Comparable

The net.sourceforge.simpleaim.Buddy object represents an active buddy.

Author:
simpleaim.sourceforge.net.

Field Summary
 long becameIdleTime
          Time when user became idle, in minutes.
 int idle
          Initial idle time, in minutes.
 boolean isAvailable
          Whether or not user is unavailable.
 java.lang.String name
          net.sourceforge.simpleaim.Buddy Name.
 int warning
          Warning level, in percentage.
 
Constructor Summary
Buddy(java.lang.String name, int warning, int idle, boolean isAvailable)
          Constructor for the net.sourceforge.simpleaim.Buddy object.
 
Method Summary
 void avail(boolean availability)
          Sets buddy's availability status
 int compareTo(java.lang.Object o)
          Compares this buddy with the specified object for order.
 long getIdle()
          Returns the buddy's idle time.
 void setIdle(int idle)
          Sets the buddy's idle time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name
net.sourceforge.simpleaim.Buddy Name.


warning

public int warning
Warning level, in percentage.


idle

public int idle
Initial idle time, in minutes.


becameIdleTime

public long becameIdleTime
Time when user became idle, in minutes.


isAvailable

public boolean isAvailable
Whether or not user is unavailable.

Constructor Detail

Buddy

public Buddy(java.lang.String name,
             int warning,
             int idle,
             boolean isAvailable)
Constructor for the net.sourceforge.simpleaim.Buddy object.

Parameters:
name - The buddy's name.
warning - The warning level of this buddy in percentage.
idle - The idle time in milliseconds.
Method Detail

avail

public void avail(boolean availability)
Sets buddy's availability status

Parameters:
availability - Whether the buddy is available

setIdle

public void setIdle(int idle)
Sets the buddy's idle time.

Parameters:
idle - The idle time in milliseconds.

getIdle

public long getIdle()
Returns the buddy's idle time.

Returns:
The idle time in minutes.

compareTo

public int compareTo(java.lang.Object o)
Compares this buddy with the specified object for order. Comparisons are based on lexicographical ordering of buddy names.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - object to be compared to
Returns:
a negative integer, zero, or a positive integer as this buddy is less than, equal to, or greater than the specified buddy.
Throws:
java.lang.ClassCastException - If the object is not type net.sourceforge.simpleaim.Buddy