Class TicketForm

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Screen
          extended by javax.microedition.lcdui.Form
              extended by TicketForm
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class TicketForm
extends javax.microedition.lcdui.Form
implements javax.microedition.lcdui.CommandListener

TicketForm is responsible for presenting ticket data to the user.

Since:
1.0
Author:
Magnus Egeberg

Field Summary
private  java.io.ByteArrayInputStream bais
           
private  java.lang.String CMD_BACK
           
private  java.lang.String CMD_EXIT
           
private  java.lang.String ENDING_KR
           
private  java.io.DataInputStream in
           
private  java.lang.String INFO_AMOUNT
           
private  java.lang.String INFO_BALANCE
           
private  java.lang.String INFO_DATE
           
private  javax.microedition.lcdui.Command tBack
           
private  javax.microedition.lcdui.Command tExit
           
private  java.lang.String TITLE_BALANCE
           
private  java.lang.String TITLE_PREVIOUS_CHARGE
           
private  TicketingSystemMIDlet ts
           
 
Constructor Summary
TicketForm(TicketingSystemMIDlet ts, byte[] data)
          TicketForm creastes the form and adds the commands.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
          Perfoms actions based on user commands
 int readByte()
          Reads a byte and returns it as an int
 int readShort()
          Reads a short and return it as an int
 
Methods inherited from class javax.microedition.lcdui.Form
append, append, append, delete, deleteAll, get, getHeight, getWidth, insert, set, setItemStateListener, size
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getTicker, getTitle, isShown, removeCommand, setCommandListener, setTicker, setTitle, sizeChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_BACK

private final java.lang.String CMD_BACK
See Also:
Constant Field Values

CMD_EXIT

private final java.lang.String CMD_EXIT
See Also:
Constant Field Values

TITLE_BALANCE

private final java.lang.String TITLE_BALANCE
See Also:
Constant Field Values

TITLE_PREVIOUS_CHARGE

private final java.lang.String TITLE_PREVIOUS_CHARGE
See Also:
Constant Field Values

INFO_BALANCE

private final java.lang.String INFO_BALANCE
See Also:
Constant Field Values

INFO_DATE

private final java.lang.String INFO_DATE
See Also:
Constant Field Values

INFO_AMOUNT

private final java.lang.String INFO_AMOUNT
See Also:
Constant Field Values

ENDING_KR

private final java.lang.String ENDING_KR
See Also:
Constant Field Values

tBack

private javax.microedition.lcdui.Command tBack

tExit

private javax.microedition.lcdui.Command tExit

bais

private java.io.ByteArrayInputStream bais

in

private java.io.DataInputStream in

ts

private TicketingSystemMIDlet ts
Constructor Detail

TicketForm

public TicketForm(TicketingSystemMIDlet ts,
                  byte[] data)
TicketForm creastes the form and adds the commands.

Parameters:
ts - The MIDlet
data - The byte array that will be presented to the user
See Also:
ByteArrayInputStream, DataInputStream
Method Detail

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable d)
Perfoms actions based on user commands

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener

readShort

public int readShort()
              throws java.lang.Exception
Reads a short and return it as an int

Returns:
The int value of the bytes
Throws:
java.lang.Exception - when failing to read the short

readByte

public int readByte()
             throws java.lang.Exception
Reads a byte and returns it as an int

Returns:
the int value of the byte
Throws:
java.lang.Exception - when failing to read the byte