net.kano.joscar.ssiitem
Class IconItem

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

public class IconItem
extends AbstractItemObj

An SSI item object holding information about a buddy icon. Note that modifying (or creating) an icon object sets that icon as the user's current icon (given that you upload it when asked).

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.


Field Summary
static java.lang.String ALIAS_DEFAULT
          A default "alias" for a buddy icon item.
static java.lang.String NAME_DEFAULT
          A default name for a buddy icon item.
 
Constructor Summary
IconItem(IconItem other)
          Creates a new buddy icon item object with the same properties as the given icon item object.
IconItem(SsiItem item)
          Creates a new buddy icon item object from the data in the given SSI item.
IconItem(java.lang.String name, int id, ExtraInfoData iconInfo)
          Creates a new buddy icon item object with the given icon name (try NAME_DEFAULT), unique icon item ID number, and icon hash block.
IconItem(java.lang.String name, int id, ExtraInfoData iconInfo, java.lang.String alias, TlvChain extraTlvs)
          Creates a new buddy icon item object with the given icon name (try NAME_DEFAULT), unique icon item ID number, and icon hash block.
 
Method Summary
 java.lang.String getAlias()
          Returns this icon item's "alias."
 ExtraInfoData getIconInfo()
          Returns the icon hash stored in this item, or null if none is stored.
 int getId()
          Returns this icon item's unique ID.
 java.lang.String getName()
          Returns this icon item's name.
 void setAlias(java.lang.String alias)
          Sets the "alias" for this icon item.
 void setIconInfo(ExtraInfoData iconInfo)
          Sets the icon hash block stored in this icon item.
 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
 

Field Detail

NAME_DEFAULT

public static final java.lang.String NAME_DEFAULT
A default name for a buddy icon item.

See Also:
Constant Field Values

ALIAS_DEFAULT

public static final java.lang.String ALIAS_DEFAULT
A default "alias" for a buddy icon item. This is just an empty string, as that is what WinAIM uses.

See Also:
Constant Field Values
Constructor Detail

IconItem

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

Parameters:
item - a buddy icon SSI item

IconItem

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

Parameters:
other - an icon item object to copy

IconItem

public IconItem(java.lang.String name,
                int id,
                ExtraInfoData iconInfo)
Creates a new buddy icon item object with the given icon name (try NAME_DEFAULT), unique icon item ID number, and icon hash block. Note that the icon hash block can be null to not store a hash at all in this item. The item will be created with an "alias" of ALIAS_DEFAULT, which is an empty string.

Parameters:
name - the "name" of this icon, normally a positive number in ASCII text format (like "2" or NAME_DEFAULT)
id - an ID number for this item
iconInfo - a block of icon hash information, or null to not store an icon hash block in this item

IconItem

public IconItem(java.lang.String name,
                int id,
                ExtraInfoData iconInfo,
                java.lang.String alias,
                TlvChain extraTlvs)
Creates a new buddy icon item object with the given icon name (try NAME_DEFAULT), unique icon item ID number, and icon hash block. Note that the icon hash block can be null to not store a hash at all in this item.

Parameters:
name - the "name" of this icon, normally a positive number in ASCII text format (like "2" or NAME_DEFAULT)
id - an ID number for this item
iconInfo - a block of icon hash information, or null to not store an icon hash block in this item
alias - some sort of "alias" for this icon; WinAIM always uses ALIAS_DEFAULT (an empty string)
extraTlvs - a list of extra TLV's to store in this item
Method Detail

getName

public final java.lang.String getName()
Returns this icon item's name. Normally a nonnegative number in ASCII text format (like "0").

Returns:
this icon item's name

getId

public final int getId()
Returns this icon item's unique ID.

Returns:
this icon item's ID

getIconInfo

public final ExtraInfoData getIconInfo()
Returns the icon hash stored in this item, or null if none is stored.

Returns:
the icon hash block stored in this item, or null if none is stored in this item

getAlias

public final java.lang.String getAlias()
Returns this icon item's "alias." As of this writing WinAIM always sets this to an empty string, or ALIAS_DEFAULT; thus, I am unsure of the value's significance. This field is called "alias" because it is stored in the same data type as a buddy's alias.

Returns:
this icon item's "alias"

setIconInfo

public final void setIconInfo(ExtraInfoData iconInfo)
Sets the icon hash block stored in this icon item. iconInfo can be null to erase this icon item's icon hash.

Parameters:
iconInfo - a new icon hash block for this buddy icon item, or null to erase this item's stored icon hash (if any)

setAlias

public final void setAlias(java.lang.String alias)
Sets the "alias" for this icon item. As of this writing this is always set to an empty string (ALIAS_DEFAULT) by WinAIM. It is called an alias because it is stored as the same data type as a buddy's alias.

Parameters:
alias - a new "alias" for this icon item

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