superwaba.ext.ce.io.builtin.pimal
Class PocketPCRecord

java.lang.Object
  |
  +--superwaba.ext.ce.io.builtin.pimal.PocketPCRecord
Direct Known Subclasses:
PocketPCAddressRecord, PocketPCDateRecord, PocketPCToDoRecord

public abstract class PocketPCRecord
extends java.lang.Object

abstract superclass for all PocketPCRecords used to minimize code in the subclasses (see setFields() and getFields())


Field Summary
protected  Vector fields
           
protected  IObject source
           
 
Constructor Summary
PocketPCRecord(IObject source)
          creates a new instance of PocketPCRecord with a given IObject source
 
Method Summary
abstract  void addExceptionalFields(Vector alreadyFoundFields)
          adds the exceptional fields to the given Vector; exceptional fields can mean that they have been read out of the note e.g.
 void delete()
          deletes this Record from the device
abstract  java.lang.String field(int position)
          return the field_name_ of a *FieldTemplate at a given position
 Vector getFields()
          this methods gets the POOM fields from the source (IObject) and maps them to Address-, Date- or ToDoField
 java.lang.String getId()
          returns the first field of the fieldname Vector (this should be the id!)
abstract  Vector getTemplates()
          returns a cloned copy of the corresponding *FieldTemplates Vector of class Constant
abstract  void handleExceptionalFields(Vector exceptionalFields)
          handles the fields that could not be stored on the device (writes them in the note e.g.)
protected  void map(VersitField value, VersitField template)
          the values of the AddressField values will be stored in the IObject source according to the given template please note that if the value has too many fields (that means is not after the vCard spec) the additional values will be DROPPED!
 java.lang.String rawReadNote()
          reads the note directly from the device and returns it
 void rawWriteNote(java.lang.String note)
          writes the note directly to the device
 void setFields(Vector fields)
          sets the fields of this record to fields
abstract  VersitField template(int position)
          returns the template at the given position from the corresponding template Vector from class Constant
abstract  int templates()
          returns the size of the corresponding *FieldTemplates Vector of class Constant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected IObject source

fields

protected Vector fields
Constructor Detail

PocketPCRecord

public PocketPCRecord(IObject source)
creates a new instance of PocketPCRecord with a given IObject source
Parameters:
source - the IObject the PocketPCRecord wraps
Method Detail

getFields

public Vector getFields()
this methods gets the POOM fields from the source (IObject) and maps them to Address-, Date- or ToDoField
Returns:
a Vector with Address-, Date- or ToDoFields of this record

setFields

public void setFields(Vector fields)
sets the fields of this record to fields
Parameters:
fields - a Vector which contains Address-, Date- or ToDoFields

map

protected void map(VersitField value,
                   VersitField template)
the values of the AddressField values will be stored in the IObject source according to the given template please note that if the value has too many fields (that means is not after the vCard spec) the additional values will be DROPPED! please do also note that the source should be resetted before starting to insert new values!
Parameters:
value - the AddressField which contains the values
template - the AddressField which contains the fieldnames on the device for the values

rawReadNote

public java.lang.String rawReadNote()
reads the note directly from the device and returns it
Returns:
the note directly read from the device

rawWriteNote

public void rawWriteNote(java.lang.String note)
writes the note directly to the device
Parameters:
note - the note to be written on the device

getId

public java.lang.String getId()
returns the first field of the fieldname Vector (this should be the id!)
Returns:
the id of this Record

delete

public void delete()
deletes this Record from the device

templates

public abstract int templates()
returns the size of the corresponding *FieldTemplates Vector of class Constant
Returns:
the number of templates for the object

template

public abstract VersitField template(int position)
returns the template at the given position from the corresponding template Vector from class Constant
Parameters:
position - the index of the template
Returns:
the template at the given index

getTemplates

public abstract Vector getTemplates()
returns a cloned copy of the corresponding *FieldTemplates Vector of class Constant
Returns:
all the corresponding templates in a Vector

field

public abstract java.lang.String field(int position)
return the field_name_ of a *FieldTemplate at a given position
Parameters:
position - the index of the fieldname to return
Returns:
the fieldname at given index

addExceptionalFields

public abstract void addExceptionalFields(Vector alreadyFoundFields)
adds the exceptional fields to the given Vector; exceptional fields can mean that they have been read out of the note e.g.
Parameters:
alreadyFoundFields - the Vector of the "regular" fields where the exceptional fields can be added

handleExceptionalFields

public abstract void handleExceptionalFields(Vector exceptionalFields)
handles the fields that could not be stored on the device (writes them in the note e.g.)
Parameters:
exceptionalFields - a Vector of the fields that could not be mapped to the device