net.kano.joscar.ssiitem
Class RootItem

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

public class RootItem
extends AbstractItemObj

An SSI item object representing the "root group," or a "meta-group" that contains all of the groups (and all other non-buddy items, implicitly). This group has a group ID of 0. You may ask why a group containing all groups is necessary when one could just iterate through the SSI items of type SsiItem.TYPE_GROUP to get a list of groups. The answer is ordering: one can move a group up or down on his or her buddy list, but this does not change the group item itself; rather, its position in this root item's group list is changed.

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
RootItem()
          Creates a new root group item object without any master group list.
RootItem(int[] groupids)
          Creates a new root group item object with the given list of ID's of groups on the buddy list.
RootItem(int[] groupids, TlvChain extraTlvs)
          Creates a new root group item object with the given list of ID's of groups on the buddy list.
RootItem(RootItem other)
          Creates a new root group item object with the same properties as the given item object.
RootItem(SsiItem item)
          Creates a new root group item object generated from the data in the given SSI item.
 
Method Summary
 int[] getGroupids()
          Returns a list of the group ID's of the groups on the buddy list, or null if this item does not contain a master group list field.
 void setGroupids(int[] groupids)
          Sets the list of groups on the buddy list.
 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

RootItem

public RootItem(SsiItem item)
Creates a new root group item object generated from the data in the given SSI item.

Parameters:
item - a root group SSI item

RootItem

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

Parameters:
other - a root group item object to copy

RootItem

public RootItem()
Creates a new root group item object without any master group list.


RootItem

public RootItem(int[] groupids)
Creates a new root group item object with the given list of ID's of groups on the buddy list.

Parameters:
groupids - a list of the group ID's of the groups on the buddy list

RootItem

public RootItem(int[] groupids,
                TlvChain extraTlvs)
Creates a new root group item object with the given list of ID's of groups on the buddy list.

Parameters:
groupids - a list of the group ID's of the groups on the buddy list
extraTlvs - a list of extra TLV's to store in this item
Method Detail

getGroupids

public final int[] getGroupids()
Returns a list of the group ID's of the groups on the buddy list, or null if this item does not contain a master group list field. The list of groups is in the order in which the groups should be displayed to the user.

Returns:
the list of groups stored in this root group item, or null if this item contains no master group list field

setGroupids

public final void setGroupids(int[] groupids)
Sets the list of groups on the buddy list.

Parameters:
groupids - a list of the group ID's of the groups on the buddy list, in the order they should appear to the user

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()