com.levelonelabs.aim
Class AIMBuddy

java.lang.Object
  extended bycom.levelonelabs.aim.AIMBuddy
All Implemented Interfaces:
XMLizable

public class AIMBuddy
extends java.lang.Object
implements XMLizable

Represents and AIM Buddy

Author:
Will Gorman, Scott Oster

Constructor Summary
AIMBuddy(java.lang.String name)
          Constructor for the AIMBuddy object
AIMBuddy(java.lang.String name, java.lang.String group)
          Constructor for the AIMBuddy object
 
Method Summary
 void addMessage(java.lang.String message)
          Adds a feature to the Message attribute of the AIMBuddy object
 void addRole(java.lang.String role)
          Adds a feature to the Role attribute of the AIMBuddy object
 void clearMessages()
          Remove all messages
 java.lang.String getGroup()
          The name of the group this buddy belongs to, in the buddylist
 java.util.ArrayList getMessages()
          Gets the messages attribute of the AIMBuddy object
 java.lang.String getName()
          Gets the name attribute of the AIMBuddy object
 java.lang.String getPreference(java.lang.String pref)
          Gets the preference attribute of the AIMBuddy object
 java.util.HashMap getPreferences()
          Gets the preferences attribute of the AIMBuddy object
 int getWarningAmount()
          Gets the current warning amount
 boolean hasMessages()
          Does buddy have messages?
 boolean hasRole(java.lang.String role)
          Do I have specified role
 boolean isBanned()
          Returns the banned.
 boolean isOnline()
          Gets the online attribute of the AIMBuddy object
 void readState(org.w3c.dom.Element fullStateElement)
          Read info from the Element
 void setBanned(boolean banned)
          Sets the banned.
 void setGroup(java.lang.String group)
          Set the group the buddy is in, in the buddy list
 void setName(java.lang.String name)
          Sets the name attribute of the AIMBuddy object
 void setOnline(boolean online)
          Sets the online attribute of the AIMBuddy object
 void setPreference(java.lang.String pref, java.lang.String val)
          Sets the preference attribute of the AIMBuddy object
 void setWarningAmount(int amount)
          Sets the current warning amount
 void writeState(org.w3c.dom.Element emptyStateElement)
          Write current into the Element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AIMBuddy

public AIMBuddy(java.lang.String name)
Constructor for the AIMBuddy object

Parameters:
name -

AIMBuddy

public AIMBuddy(java.lang.String name,
                java.lang.String group)
Constructor for the AIMBuddy object

Parameters:
name -
group - buddy group in buddylist
Method Detail

setName

public void setName(java.lang.String name)
Sets the name attribute of the AIMBuddy object

Parameters:
name - The new name value

setOnline

public void setOnline(boolean online)
Sets the online attribute of the AIMBuddy object

Parameters:
online - The new online value

setPreference

public void setPreference(java.lang.String pref,
                          java.lang.String val)
Sets the preference attribute of the AIMBuddy object

Parameters:
pref - The new preference value
val - The new preference value

getName

public java.lang.String getName()
Gets the name attribute of the AIMBuddy object

Returns:
The name value

isOnline

public boolean isOnline()
Gets the online attribute of the AIMBuddy object

Returns:
The online value

getPreference

public java.lang.String getPreference(java.lang.String pref)
Gets the preference attribute of the AIMBuddy object

Parameters:
pref -
Returns:
The preference value

getPreferences

public java.util.HashMap getPreferences()
Gets the preferences attribute of the AIMBuddy object

Returns:
The preferences value

addRole

public void addRole(java.lang.String role)
Adds a feature to the Role attribute of the AIMBuddy object

Parameters:
role - The feature to be added to the Role attribute

getMessages

public java.util.ArrayList getMessages()
Gets the messages attribute of the AIMBuddy object

Returns:
The messages value

addMessage

public void addMessage(java.lang.String message)
Adds a feature to the Message attribute of the AIMBuddy object

Parameters:
message - The feature to be added to the Message attribute

clearMessages

public void clearMessages()
Remove all messages


hasMessages

public boolean hasMessages()
Does buddy have messages?

Returns:
true for more than 0 messages

hasRole

public boolean hasRole(java.lang.String role)
Do I have specified role

Parameters:
role -
Returns:
true if buddy has the role

isBanned

public boolean isBanned()
Returns the banned.

Returns:
boolean

setBanned

public void setBanned(boolean banned)
Sets the banned.

Parameters:
banned - The banned to set

readState

public void readState(org.w3c.dom.Element fullStateElement)
Description copied from interface: XMLizable
Read info from the Element

Specified by:
readState in interface XMLizable
Parameters:
fullStateElement - DOM element to read from
See Also:
XMLizable.readState(Element)

writeState

public void writeState(org.w3c.dom.Element emptyStateElement)
Description copied from interface: XMLizable
Write current into the Element

Specified by:
writeState in interface XMLizable
Parameters:
emptyStateElement - DOM element to write to
See Also:
XMLizable.writeState(Element)

getWarningAmount

public int getWarningAmount()
Gets the current warning amount

Returns:
the warning amount

setWarningAmount

public void setWarningAmount(int amount)
Sets the current warning amount

Parameters:
amount -

setGroup

public void setGroup(java.lang.String group)
Set the group the buddy is in, in the buddy list

Parameters:
group - The name of the group this buddy belongs to.

getGroup

public java.lang.String getGroup()
The name of the group this buddy belongs to, in the buddylist

Returns:
The name of the group this buddy belongs to.


Copyright © 2001-2005 Java AIM Bot. All Rights Reserved.