superwaba.ext.ce.io.builtin
Class IObject

java.lang.Object
  |
  +--superwaba.ext.ce.io.builtin.IObject
Direct Known Subclasses:
IAppointment, IContact, ITask

public abstract class IObject
extends java.lang.Object

superclass of all the classes that represent data structures on the PocketPC device


Constructor Summary
protected IObject(int capacity, StringExt nativeString)
          creates a new IObject
 
Method Summary
abstract  void delete()
          deletes this IObject on the PPC device this method has to be implemented according to the native library call that matches his datatype
abstract  java.lang.String field(int position)
          this method must return the field name (from the corresponding i*Field Vectors of class Constant) of the given position
abstract  int fields()
          this method must return the size of the corresponding i*Field Vector of the class Constant
protected  IDate getIDate(java.lang.String fieldName)
          returns the value of a given field name as a String, ClassCast Exceptions are catched
 IRecipients getIRecipients(java.lang.String fieldName)
          returns the value of a given field name as a String, ClassCast Exceptions are catched
 IRecurrencePattern getIRecurrencePattern(java.lang.String fieldName)
          returns the value of a given field name as a String, ClassCast Exceptions are catched
protected  java.lang.String getString(java.lang.String fieldName)
          returns the value of a given field name as a String, ClassCast Exceptions are catched
 java.lang.String getValue(java.lang.String fieldName)
          returns the value which is stored under field name from the internal Hashtable fields as a String, no matter which datatype the value has.
protected  void parseNativeString(StringExt nativeString)
          this method reads out the nativeString until it reaches the next dataset Separator (defined in Constant); please note that the part that has been read out is deleted from the nativeString (thus, by calling this method the nativeString gets shorter and shorter every time)
abstract  void refresh()
          refreshes the data fields of the IObject from the PPC device this method has to be implemented according to the native library call that matches his datatype
 void reset()
          resets all the fields of the IObject except for the id
abstract  void save()
          saves the data fields of the IObject to the PPC device this method has to be implemented according to the native library call that matches his datatype
 void setValue(java.lang.String key, java.lang.String value)
          sets a field with name key to the value value; Objects according to their given data type # (within the key) will be created when necessary
 java.lang.String toString()
          provides a simple String representation of this IObject mainly for debugging purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IObject

protected IObject(int capacity,
                  StringExt nativeString)
creates a new IObject
Parameters:
capacity - of the Hashtable where the fields are stored
nativeString - the String which has been obtained from the native lib call
Method Detail

parseNativeString

protected void parseNativeString(StringExt nativeString)
this method reads out the nativeString until it reaches the next dataset Separator (defined in Constant); please note that the part that has been read out is deleted from the nativeString (thus, by calling this method the nativeString gets shorter and shorter every time)
Parameters:
nativeString - the StringExt to parse

reset

public void reset()
resets all the fields of the IObject except for the id

getValue

public java.lang.String getValue(java.lang.String fieldName)
returns the value which is stored under field name from the internal Hashtable fields as a String, no matter which datatype the value has.
Parameters:
fieldName - the field name
Returns:
the value of the field name, "" if the field is not found

getString

protected java.lang.String getString(java.lang.String fieldName)
returns the value of a given field name as a String, ClassCast Exceptions are catched
Parameters:
fieldName - the field name
Returns:
the value as a String, null if field is not found or ClassCast Exception occurs

getIDate

protected IDate getIDate(java.lang.String fieldName)
returns the value of a given field name as a String, ClassCast Exceptions are catched
Parameters:
fieldName - the field name
Returns:
the value as a IDate, null if field is not found or ClassCast Exception occurs

getIRecipients

public IRecipients getIRecipients(java.lang.String fieldName)
returns the value of a given field name as a String, ClassCast Exceptions are catched
Parameters:
fieldName - the field name
Returns:
the value as a IRecipients, null if field is not found or ClassCast Exception occurs

getIRecurrencePattern

public IRecurrencePattern getIRecurrencePattern(java.lang.String fieldName)
returns the value of a given field name as a String, ClassCast Exceptions are catched
Parameters:
fieldName - the field name
Returns:
the value as a IRecurrencePattern, null if field is not found or ClassCast Exception occurs

setValue

public void setValue(java.lang.String key,
                     java.lang.String value)
sets a field with name key to the value value; Objects according to their given data type # (within the key) will be created when necessary
Parameters:
key - the field name
value - the value as String representation

refresh

public abstract void refresh()
refreshes the data fields of the IObject from the PPC device this method has to be implemented according to the native library call that matches his datatype

save

public abstract void save()
saves the data fields of the IObject to the PPC device this method has to be implemented according to the native library call that matches his datatype

delete

public abstract void delete()
deletes this IObject on the PPC device this method has to be implemented according to the native library call that matches his datatype

field

public abstract java.lang.String field(int position)
this method must return the field name (from the corresponding i*Field Vectors of class Constant) of the given position
Parameters:
position - of the fieldname
Returns:
the name of the field

fields

public abstract int fields()
this method must return the size of the corresponding i*Field Vector of the class Constant
Returns:
the size of the fields

toString

public java.lang.String toString()
provides a simple String representation of this IObject mainly for debugging purposes
Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object