brf.j2me.dynaworks.db.palm
Class ExpenseRec

java.lang.Object
  |
  +--brf.j2me.dynaworks.db.Record
        |
        +--brf.j2me.dynaworks.db.palm.PalmRec
              |
              +--brf.j2me.dynaworks.db.palm.ExpenseRec
All Implemented Interfaces:
Dataset

public class ExpenseRec
extends PalmRec

An ExpenseRec refers to an entry in the Palm build-in expense database.

Version:
1.0
Author:
Bernd R. Fix
See Also:
ExpenseDB, PalmRec

Field Summary
static int CAT_AIR
          category values.
static int CAT_BEVERAGES
           
static int CAT_BREAKFAST
           
static int CAT_BUS
           
static int CAT_CARRENTAL
           
static int CAT_CLEANING
           
static int CAT_COMPANYMEAL
           
static int CAT_DINNER
           
static int CAT_ENTERTAINMENT
           
static int CAT_FAX
           
static int CAT_FEES
           
static int CAT_GASOLINE
           
static int CAT_GIFTS
           
static int CAT_GUESTHOUSE
           
static int CAT_HOTEL
           
static int CAT_LUNCH
           
static int CAT_MILAGE
           
static int CAT_OFFICE
           
static int CAT_OTHER
           
static int CAT_PARKING
           
static int CAT_PORTO
           
static int CAT_SNACK
           
static int CAT_SPECIAL
           
static int CAT_TAXI
           
static int CAT_TELEPHONE
           
static int CAT_TIP
           
static int CAT_TRAIN
           
static int CTRY_AUSTRALIA
          currency and country codes.
static int CTRY_AUSTRIA
           
static int CTRY_BELGIUM
           
static int CTRY_BRASIL
           
static int CTRY_CANADA
           
static int CTRY_DENMARK
           
static int CTRY_FINLAND
           
static int CTRY_FRANCE
           
static int CTRY_GERMANY
           
static int CTRY_HONGKONG
           
static int CTRY_IRLAND
           
static int CTRY_ISLAND
           
static int CTRY_ITALY
           
static int CTRY_JAPAN
           
static int CTRY_LUXEMBURG
           
static int CTRY_MEXICO
           
static int CTRY_NETHERLANDS
           
static int CTRY_NEWZEALAND
           
static int CTRY_NORWAY
           
static int CTRY_SPAIN
           
static int CTRY_SWEDEN
           
static int CTRY_SWITZERLAND
           
static int CTRY_UK
           
static int CTRY_USA
           
private static java.lang.String[] currencies
          List of currency symbols.
private  byte flags
          bit-coded flags.
static int FLD_AMOUNT
          field access constants.
static int FLD_CITY
           
static int FLD_NOTE
           
static int FLD_PEOPLE
           
static int FLD_SELLER
           
static int PAY_ADVANCE
           
static int PAY_AMEX
          payment methods.
static int PAY_CASH
           
static int PAY_CHEQUE
           
static int PAY_CREDITCARD
           
static int PAY_MASTERCARD
           
static int PAY_NONE
           
static int PAY_VISA
           
private  int[] strLength
           
private  int[] strStart
          parameters to address strings in the record.
 
Fields inherited from class brf.j2me.dynaworks.db.Record
content, fields, sequence
 
Constructor Summary
ExpenseRec()
          instanciate a new record.
 
Method Summary
(package private) static void ()
           
 int getCategory()
          Get the category of expense.
 int getCurrencyCode()
          Get the currency code (0..23)
 java.lang.String getCurrencyTag()
          Get the currency symbol for this expense.
 Date getDate()
          Get the date for the expense.
 int getPayment()
          Get the method of payment.
 java.lang.String getString(int field)
          returns a field from an expense record.
 void update(boolean tomem)
          Transfer the record content to the field variables.
 
Methods inherited from class brf.j2me.dynaworks.db.palm.PalmRec
bitCount, intValue, shortValue
 
Methods inherited from class brf.j2me.dynaworks.db.Record
addField, getBytes, getContent, getField, getInt, getShort, getString, readField, setBytes, setContent, setField, setInt, setShort, setString, size, writeField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

flags

private byte flags
bit-coded flags.

strStart

private int[] strStart
parameters to address strings in the record.


strLength

private int[] strLength

CAT_AIR

public static final int CAT_AIR
category values.

CAT_BREAKFAST

public static final int CAT_BREAKFAST

CAT_BUS

public static final int CAT_BUS

CAT_COMPANYMEAL

public static final int CAT_COMPANYMEAL

CAT_CARRENTAL

public static final int CAT_CARRENTAL

CAT_DINNER

public static final int CAT_DINNER

CAT_ENTERTAINMENT

public static final int CAT_ENTERTAINMENT

CAT_FAX

public static final int CAT_FAX

CAT_GASOLINE

public static final int CAT_GASOLINE

CAT_GIFTS

public static final int CAT_GIFTS

CAT_HOTEL

public static final int CAT_HOTEL

CAT_SPECIAL

public static final int CAT_SPECIAL

CAT_CLEANING

public static final int CAT_CLEANING

CAT_BEVERAGES

public static final int CAT_BEVERAGES

CAT_GUESTHOUSE

public static final int CAT_GUESTHOUSE

CAT_LUNCH

public static final int CAT_LUNCH

CAT_MILAGE

public static final int CAT_MILAGE

CAT_OTHER

public static final int CAT_OTHER

CAT_PARKING

public static final int CAT_PARKING

CAT_PORTO

public static final int CAT_PORTO

CAT_SNACK

public static final int CAT_SNACK

CAT_TRAIN

public static final int CAT_TRAIN

CAT_OFFICE

public static final int CAT_OFFICE

CAT_TAXI

public static final int CAT_TAXI

CAT_TELEPHONE

public static final int CAT_TELEPHONE

CAT_TIP

public static final int CAT_TIP

CAT_FEES

public static final int CAT_FEES

PAY_AMEX

public static final int PAY_AMEX
payment methods.

PAY_CASH

public static final int PAY_CASH

PAY_CHEQUE

public static final int PAY_CHEQUE

PAY_CREDITCARD

public static final int PAY_CREDITCARD

PAY_MASTERCARD

public static final int PAY_MASTERCARD

PAY_ADVANCE

public static final int PAY_ADVANCE

PAY_VISA

public static final int PAY_VISA

PAY_NONE

public static final int PAY_NONE

FLD_AMOUNT

public static final int FLD_AMOUNT
field access constants.

FLD_SELLER

public static final int FLD_SELLER

FLD_CITY

public static final int FLD_CITY

FLD_PEOPLE

public static final int FLD_PEOPLE

FLD_NOTE

public static final int FLD_NOTE

CTRY_AUSTRALIA

public static final int CTRY_AUSTRALIA
currency and country codes.

CTRY_AUSTRIA

public static final int CTRY_AUSTRIA

CTRY_BELGIUM

public static final int CTRY_BELGIUM

CTRY_BRASIL

public static final int CTRY_BRASIL

CTRY_CANADA

public static final int CTRY_CANADA

CTRY_DENMARK

public static final int CTRY_DENMARK

CTRY_FINLAND

public static final int CTRY_FINLAND

CTRY_FRANCE

public static final int CTRY_FRANCE

CTRY_GERMANY

public static final int CTRY_GERMANY

CTRY_HONGKONG

public static final int CTRY_HONGKONG

CTRY_ISLAND

public static final int CTRY_ISLAND

CTRY_IRLAND

public static final int CTRY_IRLAND

CTRY_ITALY

public static final int CTRY_ITALY

CTRY_JAPAN

public static final int CTRY_JAPAN

CTRY_LUXEMBURG

public static final int CTRY_LUXEMBURG

CTRY_MEXICO

public static final int CTRY_MEXICO

CTRY_NETHERLANDS

public static final int CTRY_NETHERLANDS

CTRY_NEWZEALAND

public static final int CTRY_NEWZEALAND

CTRY_NORWAY

public static final int CTRY_NORWAY

CTRY_SPAIN

public static final int CTRY_SPAIN

CTRY_SWEDEN

public static final int CTRY_SWEDEN

CTRY_SWITZERLAND

public static final int CTRY_SWITZERLAND

CTRY_UK

public static final int CTRY_UK

CTRY_USA

public static final int CTRY_USA

currencies

private static java.lang.String[] currencies
List of currency symbols.
Constructor Detail

ExpenseRec

public ExpenseRec()
instanciate a new record.

Method Detail

static void ()

update

public void update(boolean tomem)
Transfer the record content to the field variables.

Although an MailRecord is derived from a "normal" record, it's not using the RecordField mechanism to access its data but it stores and retreives its fields in a different way (directly from the content byte array).

Overrides:
update in class Record
Parameters:
tomem - boolean - direction of transfer

getDate

public Date getDate()
Get the date for the expense.

Returns:
brf.j2me.dynaworks.util.Date - date of expense.
See Also:
Date

getCategory

public int getCategory()
Get the category of expense.

Returns:
int - category of expense.
See Also:
CAT_AIR

getCurrencyCode

public int getCurrencyCode()
Get the currency code (0..23)

Returns:
int - currency code.
See Also:
CTRY_AUSTRALIA

getCurrencyTag

public java.lang.String getCurrencyTag()
Get the currency symbol for this expense.

Returns:
String - currency symbol of expense.
See Also:
getCurrencyCode()

getString

public java.lang.String getString(int field)
returns a field from an expense record.

The argument 'field' is an integer from the constant pool "FLD_????'. To read the name stored in the address, you use something like:

"String name = rec.getString (rec.FLD_AMOUNT);"

Parameters:
field - int - constant of field to access
Returns:
String - content of field
See Also:
FLD_AMOUNT

getPayment

public int getPayment()
Get the method of payment.

Returns:
int - payment method.
See Also:
PAY_AMEX