net.kano.joscar.ssiitem
Class SimpleNamedItem

java.lang.Object
  extended byAbstractItemObj
      extended bySimpleNamedItem
All Implemented Interfaces:
SsiItemObj
Direct Known Subclasses:
DenyItem, PermitItem

public abstract class SimpleNamedItem
extends AbstractItemObj

A base class for the two item types that only contain a name and reside in the root group (group 0x0000). These are PermitItem and DenyItem.


Constructor Summary
protected SimpleNamedItem(SimpleNamedItem other)
          Creates a new simple named item object with the same properties as the given item.
protected SimpleNamedItem(SsiItem item)
          Creates a new simple named item object generated from the data in the given SSI item block.
protected SimpleNamedItem(java.lang.String sn, int id)
          Creates a new simple named item object with the given screenname and the given item ID.
protected SimpleNamedItem(java.lang.String sn, int id, TlvChain extraTlvs)
          Creates a new simple named item object with the given screenname and the given item ID.
 
Method Summary
 int getId()
          Returns the SSI item ID of this simple named item object.
protected abstract  int getItemType()
          Returns the SSI item type of this item.
 java.lang.String getScreenname()
          Returns this item's screenname.
 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

SimpleNamedItem

protected SimpleNamedItem(SsiItem item)
Creates a new simple named item object generated from the data in the given SSI item block.

Parameters:
item - a simple named SSI item

SimpleNamedItem

protected SimpleNamedItem(SimpleNamedItem other)
Creates a new simple named item object with the same properties as the given item.

Parameters:
other - a simple named item object

SimpleNamedItem

protected SimpleNamedItem(java.lang.String sn,
                          int id)
Creates a new simple named item object with the given screenname and the given item ID.

Parameters:
sn - the screenname for this item
id - this item's SSI item ID

SimpleNamedItem

protected SimpleNamedItem(java.lang.String sn,
                          int id,
                          TlvChain extraTlvs)
Creates a new simple named item object with the given screenname and the given item ID.

Parameters:
sn - the screenname for this item
id - this item's SSI item ID
extraTlvs - a list of extra TLV's to store in this item
Method Detail

getScreenname

public final java.lang.String getScreenname()
Returns this item's screenname.

Returns:
this item's screenname

getId

public final int getId()
Returns the SSI item ID of this simple named item object.

Returns:
this item's SSI item ID

getItemType

protected abstract int getItemType()
Returns the SSI item type of this item. This should normally return one of the SsiItem.TYPE_* constants.

Returns:
the SSI item type of this 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()