org.jSyncManager.API.Protocol.Util.StdApps

Class AddressAppBlock

Implemented Interfaces:
Serializable

public class AddressAppBlock
extends AbstractAppBlock

AddAppBlock record abstraction/parser class. This class reprenests a Palm Address Application database record.

Field Summary

static byte
AUSTRALIA
Country code for Australia.
static byte
AUSTRIA
Country code for Austria.
static byte
BELGIUM
Country code for Belgium.
static byte
BRAZIL
Country code for Brazil.
static byte
CANADA
Country code for Canada.
static char
CATEGORY1
The flag for Category #1.
static char
CATEGORY10
The flag for Category #10.
static char
CATEGORY11
The flag for Category #11.
static char
CATEGORY12
The flag for Category #12.
static char
CATEGORY13
The flag for Category #13.
static char
CATEGORY14
The flag for Category #14.
static char
CATEGORY15
The flag for Category #15.
static char
CATEGORY16
The flag for Category #16.
static char
CATEGORY2
The flag for Category #2.
static char
CATEGORY3
The flag for Category #3.
static char
CATEGORY4
The flag for Category #4.
static char
CATEGORY5
The flag for Category #5.
static char
CATEGORY6
The flag for Category #6.
static char
CATEGORY7
The flag for Category #7.
static char
CATEGORY8
The flag for Category #8.
static char
CATEGORY9
The flag for Category #9.
static byte
DENMARK
Country code for Denmark.
static byte
FINLAND
Country code for Finland.
static byte
FRANCE
Country code for France.
static byte
GERMANY
Country code for Germany.
static byte
HONGKONG
Country code for Hong Kong.
static byte
ICELAND
Country code for Iceland.
static byte
IRELAND
Country code for Ireland.
static byte
ITALY
Country code for Italy.
static byte
JAPAN
Country code for Japan.
static byte
LUXEMBOURG
Country code for Luxembourg.
static byte
MEXICO
Country code for Mexico.
static byte
NETHERLANDS
Country code for the Netherlands.
static byte
NEWZEALAND
Country code for New Zealand.
static byte
NORWAY
Country code for Norway.
static int
NUM_FIELD_LABELS
The total number of possible field labels.
static byte
SPAIN
Country code for Spain.
static byte
SWEDEN
Country code for Sweden.
static byte
SWITZERLAND
Country code for Switzerland.
static byte
UNITEDKINGDOM
Country code for the United Kingdom.
static byte
UNITEDSTATES
Country code for the United States of America.

Fields inherited from class org.jSyncManager.API.Protocol.Util.StdApps.AbstractAppBlock

categories, lastUniqueID, numCategories, sortOrder

Fields inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock

blockSize, data

Constructor Summary

AddressAppBlock()
AddressAppBlock default constructor.
AddressAppBlock(DLPBlock block)
AddressAppBlock constructor from DLPBlock.

Method Summary

protected void
generateData()
Generate the data block from the existing data.
byte
getCountryCode()
Return the country code for this object.
static String
getDatabaseName()
Returns the name of the database on the Palm this app block processes.
String
getFieldLabel(int i)
Return the specified Field Labels as a String variable.
String
getFieldLabelByBitmap(int i)
Return the Fields Label by the offset value, derived from the bitmap.
boolean
getViewByCompany()
Return a boolean value denoting whether to view by company.
boolean
isFieldModified(int category)
Return a boolean value denoting whether a field is modified by given category.
protected void
parseFields()
Parse the byte array data block to the AddressAppBlock data fields.
void
setCountryCode(byte newValue)
Set the country code.
void
setFieldLabel(String label, int i)
Set the Field Label by index.
void
setViewByCompany(boolean newValue)
Set whether to view by company.

Methods inherited from class org.jSyncManager.API.Protocol.Util.StdApps.AbstractAppBlock

addCategory, findCategoryInfo, findCategoryInfoByName, findCategoryInfoObject, getCategories, getCategoryInfo, getLastUniqueID, getNumCategories, getSortOrder, setCategoryInfo, setLastUniqueID, setSortOrder

Methods inherited from class org.jSyncManager.API.Protocol.Util.DLPBlock

generateData, getBlockSize, getData, parseFields, setData, toString

Field Details

AUSTRALIA

public static final byte AUSTRALIA
Country code for Australia.
Field Value:
0

AUSTRIA

public static final byte AUSTRIA
Country code for Austria.
Field Value:
1

BELGIUM

public static final byte BELGIUM
Country code for Belgium.
Field Value:
2

BRAZIL

public static final byte BRAZIL
Country code for Brazil.
Field Value:
3

CANADA

public static final byte CANADA
Country code for Canada.
Field Value:
4

CATEGORY1

public static final char CATEGORY1
The flag for Category #1.
Field Value:
'\u0001'

CATEGORY10

public static final char CATEGORY10
The flag for Category #10.
Field Value:
'\u0200'

CATEGORY11

public static final char CATEGORY11
The flag for Category #11.
Field Value:
'\u0400'

CATEGORY12

public static final char CATEGORY12
The flag for Category #12.
Field Value:
'\u0800'

CATEGORY13

public static final char CATEGORY13
The flag for Category #13.
Field Value:
'\u1000'

CATEGORY14

public static final char CATEGORY14
The flag for Category #14.
Field Value:
'\u2000'

CATEGORY15

public static final char CATEGORY15
The flag for Category #15.
Field Value:
'\u4000'

CATEGORY16

public static final char CATEGORY16
The flag for Category #16.
Field Value:
'\u8000'

CATEGORY2

public static final char CATEGORY2
The flag for Category #2.
Field Value:
'\u0002'

CATEGORY3

public static final char CATEGORY3
The flag for Category #3.
Field Value:
'\u0004'

CATEGORY4

public static final char CATEGORY4
The flag for Category #4.
Field Value:
'\b'

CATEGORY5

public static final char CATEGORY5
The flag for Category #5.
Field Value:
'\u0010'

CATEGORY6

public static final char CATEGORY6
The flag for Category #6.
Field Value:
' '

CATEGORY7

public static final char CATEGORY7
The flag for Category #7.
Field Value:
'@'

CATEGORY8

public static final char CATEGORY8
The flag for Category #8.
Field Value:
'\u0080'

CATEGORY9

public static final char CATEGORY9
The flag for Category #9.
Field Value:
'\u0100'

DENMARK

public static final byte DENMARK
Country code for Denmark.
Field Value:
5

FINLAND

public static final byte FINLAND
Country code for Finland.
Field Value:
6

FRANCE

public static final byte FRANCE
Country code for France.
Field Value:
7

GERMANY

public static final byte GERMANY
Country code for Germany.
Field Value:
8

HONGKONG

public static final byte HONGKONG
Country code for Hong Kong.
Field Value:
9

ICELAND

public static final byte ICELAND
Country code for Iceland.
Field Value:
10

IRELAND

public static final byte IRELAND
Country code for Ireland.
Field Value:
11

ITALY

public static final byte ITALY
Country code for Italy.
Field Value:
12

JAPAN

public static final byte JAPAN
Country code for Japan.
Field Value:
13

LUXEMBOURG

public static final byte LUXEMBOURG
Country code for Luxembourg.
Field Value:
14

MEXICO

public static final byte MEXICO
Country code for Mexico.
Field Value:
15

NETHERLANDS

public static final byte NETHERLANDS
Country code for the Netherlands.
Field Value:
16

NEWZEALAND

public static final byte NEWZEALAND
Country code for New Zealand.
Field Value:
17

NORWAY

public static final byte NORWAY
Country code for Norway.
Field Value:
18

NUM_FIELD_LABELS

public static final int NUM_FIELD_LABELS
The total number of possible field labels.
Field Value:
22

SPAIN

public static final byte SPAIN
Country code for Spain.
Field Value:
19

SWEDEN

public static final byte SWEDEN
Country code for Sweden.
Field Value:
20

SWITZERLAND

public static final byte SWITZERLAND
Country code for Switzerland.
Field Value:
21

UNITEDKINGDOM

public static final byte UNITEDKINGDOM
Country code for the United Kingdom.
Field Value:
22

UNITEDSTATES

public static final byte UNITEDSTATES
Country code for the United States of America.
Field Value:
23

Constructor Details

AddressAppBlock

public AddressAppBlock()
AddressAppBlock default constructor.

AddressAppBlock

public AddressAppBlock(DLPBlock block)
            throws ParseException
AddressAppBlock constructor from DLPBlock. This constructor will parse the DLPBlock data.
Parameters:
block - the DLPBlock object containing the Address databases app block.

Method Details

generateData

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

getCountryCode

public byte getCountryCode()
Return the country code for this object.
Returns:
the country code for this object.

getDatabaseName

public static String getDatabaseName()
Returns the name of the database on the Palm this app block processes.
Returns:
the name of the database on the Palm this app block processes.

getFieldLabel

public String getFieldLabel(int i)
Return the specified Field Labels as a String variable.
Parameters:
i - the index of the field label to retreive.
Returns:
the specified Field Labels as a String variable.

getFieldLabelByBitmap

public String getFieldLabelByBitmap(int i)
Return the Fields Label by the offset value, derived from the bitmap.
Parameters:
i - the bitmap of the field label to retreive.
Returns:
the Fields Label requested.

getViewByCompany

public boolean getViewByCompany()
Return a boolean value denoting whether to view by company.
Returns:
true if view-by-company is selected, false otherwise.

isFieldModified

public boolean isFieldModified(int category)
Return a boolean value denoting whether a field is modified by given category.
Parameters:
category - the category to test.
Returns:
true if the field label has been modified, false otherwise.

parseFields

protected void parseFields()
            throws ParseException
Parse the byte array data block to the AddressAppBlock data fields.
Overrides:
parseFields in interface DLPBlock
Throws:
ParseException - if the data cannot be parsed correctly.

setCountryCode

public void setCountryCode(byte newValue)
Set the country code.
Parameters:
newValue - the new country code to use.

setFieldLabel

public void setFieldLabel(String label,
                          int i)
Set the Field Label by index.
Parameters:
label - the label to use.
i - the index to write the label to.

setViewByCompany

public void setViewByCompany(boolean newValue)
Set whether to view by company.
Parameters:
newValue - true if you want to view the records by company, false if by name.