net.kano.joscar.ssiitem
Class GroupItem

java.lang.Object
  extended byAbstractItemObj
      extended byGroupItem
All Implemented Interfaces:
SsiItemObj

public class GroupItem
extends AbstractItemObj

An SSI item object representing a "buddy group," or a group of buddies. These are just your normal buddy list groups.

Note that this class is only used to store data and that changes to this object are not reflected on the server without sending the changes to the server with a ModifyItemsCmd.


Constructor Summary
GroupItem(GroupItem other)
          Creates a new buddy group item object with the same properties as the given object.
GroupItem(SsiItem item)
          Creates a new buddy group item object from the data in the given SSI item.
GroupItem(java.lang.String name, int id)
          Creates a new buddy group item object with the given group name and the given group ID.
GroupItem(java.lang.String name, int id, int[] buddies)
          Creates a new buddy group item object with the given group name, group ID, and list of "child" buddy ID's.
GroupItem(java.lang.String name, int id, int[] buddies, TlvChain extraTlvs)
          Creates a new buddy group item object with the given group name, group ID, and list of "child" buddy ID's.
 
Method Summary
 int[] getBuddies()
          Returns a list of the ID's of the buddies in this group.
 java.lang.String getGroupName()
          Returns the name of this group, like "Family."
 int getId()
          Returns the group ID of this group.
 void setBuddies(int[] buddies)
          Sets the buddies in this group.
 SsiItem toSsiItem()
          Returns an SsiItem that represents this item object.
 java.lang.String toString()
           
 
Methods inherited from class AbstractItemObj
addExtraTlvs, copyExtraTlvs, generateItem, generateSsiItems, getExtraTlvs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupItem

public GroupItem(SsiItem item)
Creates a new buddy group item object from the data in the given SSI item.

Parameters:
item - the buddy group SSI item

GroupItem

public GroupItem(GroupItem other)
Creates a new buddy group item object with the same properties as the given object.

Parameters:
other - a buddy group item object to copy

GroupItem

public GroupItem(java.lang.String name,
                 int id)
Creates a new buddy group item object with the given group name and the given group ID. The group is created with no buddies.

Parameters:
name - the name of this group, like "Family"
id - a unique group ID for this group

GroupItem

public GroupItem(java.lang.String name,
                 int id,
                 int[] buddies)
Creates a new buddy group item object with the given group name, group ID, and list of "child" buddy ID's.

Parameters:
name - the name of this group, like "Family"
id - a unique group ID for this group
buddies - a list of the ID's of buddies in this group

GroupItem

public GroupItem(java.lang.String name,
                 int id,
                 int[] buddies,
                 TlvChain extraTlvs)
Creates a new buddy group item object with the given group name, group ID, and list of "child" buddy ID's.

Parameters:
name - the name of this group, like "Family"
id - a unique group ID for this group
buddies - a list of the ID's of buddies in this group
extraTlvs - a list of extra TLV's to store in this item
Method Detail

getGroupName

public final java.lang.String getGroupName()
Returns the name of this group, like "Family."

Returns:
this group's name

getId

public final int getId()
Returns the group ID of this group. This ID is unique in the set of group ID's in this user's server-stored information block.

Returns:
this group's group ID

getBuddies

public final int[] getBuddies()
Returns a list of the ID's of the buddies in this group. Note that this will be null if this item has no child buddy field.

Returns:
a list of the ID's of the buddies in this group, or null if this group item does not contain a child buddy field

setBuddies

public final void setBuddies(int[] buddies)
Sets the buddies in this group. The given list should contain the buddy ID's of the buddies in this group. This can be null to not store a child buddy list in this item at all.

Parameters:
buddies - a list of the ID's of the buddies in this group, or null to erase this group's child buddy list

toSsiItem

public SsiItem toSsiItem()
Description copied from interface: SsiItemObj
Returns an SsiItem that represents this item object.

Returns:
an SsiItem that represents this item object

toString

public java.lang.String toString()