jSyncManager

org.jSyncManager.API.Protocol.Util.StdApps
Class ExpenseAppBlock

java.lang.Object
  |
  +--org.jSyncManager.API.Protocol.Util.DLPBlock
        |
        +--org.jSyncManager.API.Protocol.Util.StdApps.ExpenseAppBlock
All Implemented Interfaces:
java.io.Serializable

public class ExpenseAppBlock
extends DLPBlock

Application information block for the Palm Expense database.

Version:
$Revision: 1.9 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: yaztromo $ on $Date: 2003/05/13 19:29:46 $.
See Also:
Serialized Form

Inner Class Summary
(package private)  class ExpenseAppBlock.CurrencyInfo
          Internal class for currency information.
 
Field Summary
static byte COUNTRY
          A value for the COUNTRY field.
static byte EXCHANGE_RATE
          A value for the EXCHANGE RATE field.
static byte MAX_CUSTOM_CURRENCIES
          A value representing the maximum number of custom currencies.
static byte SORT_BY_DATE
          A value to denote this database is to be sorted by date.
static byte SORT_BY_TYPE
          A value to denote this database is to be sorted by type.
static byte SYMBOL
          A value for the SYMBOL field.
 
Fields inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock
blockSize, data
 
Constructor Summary
ExpenseAppBlock()
          ExpenseAppBlock default constructor.
ExpenseAppBlock(DLPBlock block)
          Construct an ExpenseAppBlock with the given DLPBlock.
 
Method Summary
 int findCategoryInfo(int i)
          Find the category info block given the category ID.
protected  void generateData()
          Generate the raw data block from the existing fields.
 CategoryInfo getCategoryInfo(int i)
          Get the category info block given the category index.
 java.lang.String getCurrencyInfo(byte type, int i)
          Return a String representation of the currency info block.
 byte getLastUniqueID()
          Return the last unique ID.
 int getNumCategories()
          Return the number of categories.
 byte getSortOrder()
          Get the sort order for the data records.
protected  void parseFields()
          Parse the data fields.
 void setCategoryInfo(CategoryInfo categoryinfo, int i)
          Set the category info block, given the index.
 void setCurrencyInfo(byte type, int i, java.lang.String s)
          Set the category info field value s for the type type and index i given.
 void setSortOrder(byte order)
          Set the sort order of this application block.
 
Methods inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock
getBlockSize, getData, setData, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SORT_BY_DATE

public static final byte SORT_BY_DATE
A value to denote this database is to be sorted by date.

SORT_BY_TYPE

public static final byte SORT_BY_TYPE
A value to denote this database is to be sorted by type.

MAX_CUSTOM_CURRENCIES

public static final byte MAX_CUSTOM_CURRENCIES
A value representing the maximum number of custom currencies.

COUNTRY

public static final byte COUNTRY
A value for the COUNTRY field.

SYMBOL

public static final byte SYMBOL
A value for the SYMBOL field.

EXCHANGE_RATE

public static final byte EXCHANGE_RATE
A value for the EXCHANGE RATE field.
Constructor Detail

ExpenseAppBlock

public ExpenseAppBlock()
ExpenseAppBlock default constructor.

ExpenseAppBlock

public ExpenseAppBlock(DLPBlock block)
Construct an ExpenseAppBlock with the given DLPBlock.
Parameters:
block - a DLPAppBlock object containing app block information from the Expense database.
Method Detail

findCategoryInfo

public int findCategoryInfo(int i)
Find the category info block given the category ID.
Parameters:
i - requested category ID.
Returns:
index of requested category.

generateData

protected void generateData()
Generate the raw data block from the existing fields.
Overrides:
generateData in class DLPBlock

getCategoryInfo

public CategoryInfo getCategoryInfo(int i)
Get the category info block given the category index.
Parameters:
i - index to the desired category info.
Returns:
the requested category information object.

getCurrencyInfo

public java.lang.String getCurrencyInfo(byte type,
                                        int i)
Return a String representation of the currency info block.
Parameters:
type - byte data of information type requested.
i - int index to currency info block.
Returns:
the requested currency information.

getLastUniqueID

public byte getLastUniqueID()
Return the last unique ID.
Returns:
the last unique ID.

getNumCategories

public int getNumCategories()
Return the number of categories.
Returns:
the number of categories.

getSortOrder

public byte getSortOrder()
Get the sort order for the data records.
Returns:
the sort order used by this database.

parseFields

protected void parseFields()
Parse the data fields.
Overrides:
parseFields in class DLPBlock

setCategoryInfo

public void setCategoryInfo(CategoryInfo categoryinfo,
                            int i)
Set the category info block, given the index.
Parameters:
i - the index of the category info slot.

setCurrencyInfo

public void setCurrencyInfo(byte type,
                            int i,
                            java.lang.String s)
Set the category info field value s for the type type and index i given.
Parameters:
type - byte value of the currency field type.
i - int value of the index for the requested category info block.
s - String value of the data to set.

setSortOrder

public void setSortOrder(byte order)
Set the sort order of this application block.
Parameters:
order - byte representation of the sort order.

jSyncManager

Copyright (c) 1999 - 2003 Brad BARCLAY and others. All Rights Reserved.