net.kbox.component
Class KCommand

java.lang.Object
  extended by javax.microedition.lcdui.Command
      extended by net.kbox.component.KCommand
All Implemented Interfaces:
Unique

public class KCommand
extends javax.microedition.lcdui.Command
implements Unique

KCommand extends Command, containing two new field: uniqueID and parameters. Beside these, it's nothing different with a Command.

Author:
blackBox

Field Summary
protected  KHashtable attributes
           
protected  java.lang.String uniqueID
           
 
Fields inherited from class javax.microedition.lcdui.Command
BACK, CANCEL, EXIT, HELP, ITEM, OK, SCREEN, STOP
 
Constructor Summary
KCommand(java.lang.String shortLabel, int commandType, int priority, java.lang.String uniqueID)
           
KCommand(java.lang.String label, int commandType, int priority, java.lang.String uniqueID, java.util.Hashtable parameters)
          Deprecated.  
KCommand(java.lang.String shortLabel, java.lang.String longLabel, int commandType, int priority, java.lang.String uniqueID)
           
KCommand(java.lang.String shortLabel, java.lang.String longLabel, int commandType, int priority, java.lang.String uniqueID, java.util.Hashtable parameters)
          Deprecated.  
 
Method Summary
 boolean containsAttribute(java.lang.Object key)
           
 java.lang.Object getAttribute(java.lang.String name)
           
 byte getByte(java.lang.String name)
           
 double getDouble(java.lang.String name)
           
 float getFloat(java.lang.String name)
           
 int getInt(java.lang.String name)
           
 long getLong(java.lang.String name)
           
 java.util.Hashtable getParameters()
          Deprecated.  
 short getShort(java.lang.String name)
           
 java.lang.String getString(java.lang.String name)
           
 java.lang.String getUniqueID()
          Get the uniqueID.
 KCommand setAttribute(java.lang.Object key, java.lang.Object value)
           
 KCommand setAttributes(java.util.Hashtable attributes)
          Put all the attributes in specified Hashtable to KCommand.
 KCommand setParameters(java.util.Hashtable parameters)
          Deprecated.  
 void setUniqueID(java.lang.String uniqueID)
          Set a uniqueID.
 
Methods inherited from class javax.microedition.lcdui.Command
getCommandType, getLabel, getLongLabel, getPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uniqueID

protected java.lang.String uniqueID

attributes

protected KHashtable attributes
Constructor Detail

KCommand

public KCommand(java.lang.String label,
                int commandType,
                int priority,
                java.lang.String uniqueID,
                java.util.Hashtable parameters)
Deprecated. 

Create a new KCommand. UniqueID is used to identify a menu command event when forward command,and when the command is forward with the parameters Use KCommand(String shortLabel, int commandType, int priority, String uniqueID) and setAttribute(Object key,Object value) to instead.

Parameters:
label -
commandType -
priority -
uniqueID -
parameters -

KCommand

public KCommand(java.lang.String shortLabel,
                int commandType,
                int priority,
                java.lang.String uniqueID)

KCommand

public KCommand(java.lang.String shortLabel,
                java.lang.String longLabel,
                int commandType,
                int priority,
                java.lang.String uniqueID,
                java.util.Hashtable parameters)
Deprecated. 

Use KCommand(String shortLabel, int commandType, int priority, String uniqueID) and setAttribute(Object key,Object value) to instead.

Parameters:
shortLabel -
longLabel -
commandType -
priority -
uniqueID -
parameters -

KCommand

public KCommand(java.lang.String shortLabel,
                java.lang.String longLabel,
                int commandType,
                int priority,
                java.lang.String uniqueID)
Parameters:
shortLabel -
longLabel -
commandType -
priority -
uniqueID -
Method Detail

setUniqueID

public void setUniqueID(java.lang.String uniqueID)
Set a uniqueID.

Parameters:
uniqueID -

getUniqueID

public java.lang.String getUniqueID()
Get the uniqueID.

Specified by:
getUniqueID in interface Unique

getParameters

public java.util.Hashtable getParameters()
Deprecated. 

Get the parameters.


setParameters

public KCommand setParameters(java.util.Hashtable parameters)
Deprecated. 

Set a Parameters.

Parameters:
parameters -

setAttributes

public KCommand setAttributes(java.util.Hashtable attributes)
Put all the attributes in specified Hashtable to KCommand.

Parameters:
attributes -
Returns:
the KCommand

getString

public java.lang.String getString(java.lang.String name)

getInt

public int getInt(java.lang.String name)

getDouble

public double getDouble(java.lang.String name)

getByte

public byte getByte(java.lang.String name)

getShort

public short getShort(java.lang.String name)

getLong

public long getLong(java.lang.String name)

getFloat

public float getFloat(java.lang.String name)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)

setAttribute

public KCommand setAttribute(java.lang.Object key,
                             java.lang.Object value)

containsAttribute

public boolean containsAttribute(java.lang.Object key)