com.sybase.uep.bobclient.data
Class LogicalType

java.lang.Object
  extended by com.sybase.uep.bobclient.data.LogicalType

public class LogicalType
extends java.lang.Object

This is the Logical type class. This will contain all the logical type information. Also contains PIM information if applicable

Author:
tdang

Field Summary
static java.lang.String LOGICAL_TYPE_ADDRESS
           
static java.lang.String LOGICAL_TYPE_DATE
           
static java.lang.String LOGICAL_TYPE_DATETIME
           
static java.lang.String LOGICAL_TYPE_EMAIL
           
static java.lang.String LOGICAL_TYPE_IMAGE
           
static java.lang.String LOGICAL_TYPE_PHONE
           
static java.lang.String LOGICAL_TYPE_URL
           
 
Constructor Summary
LogicalType(int pimApplication, int pimField, int pimFieldAttribute)
          This constructor will be used for Phone type.
LogicalType(int pimApplication, int pimField, int pimFieldAttribute, int pimSubFieldAttribute)
          This constructor will be used for Address and Name types that have multiple subfields.
LogicalType(java.lang.String type)
          This constructor will be used by general logical types that have nothing to do with PIM applications.
 
Method Summary
 int getPIMApplication()
          Get the PIM application
 int getPIMField()
          Get PIM Field
 int getPIMFieldAttribute()
          Get PIM field attribute
 int getPIMSubFieldAttribute()
          Get PIM sub field attribute
 java.lang.String getType()
          Get the logical type
 boolean isEmail()
          Check to see if this logical type is of email type
static boolean isEmailType(LogicalType type)
           
 boolean isImage()
          Check to see if of image type
static boolean isImageType(LogicalType type)
           
 boolean isPhone()
          Check to see if this logical type is of phone type
static boolean isPhoneType(LogicalType type)
           
 boolean isPIMAddress()
          Check to see if this logical type pim application field is of type address
 boolean isPIMFieldDate()
          Check to see if this logical type pim application field is of type date
 boolean isPIMFieldDateTime()
          Check to see if this logical type pim application field is of type date time
static boolean isPIMFieldDateTimeType(LogicalType type)
           
static boolean isPIMFieldDateType(LogicalType type)
           
 boolean isPIMHomeAddress()
          Check to see if this logical type pim application field is of type home address
 boolean isPIMWorkAddress()
          Check to see if this logical type pim application field is of type work address
 boolean isURL()
          Check to see if this logical type is of url type
static boolean isURLType(LogicalType type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGICAL_TYPE_EMAIL

public static final java.lang.String LOGICAL_TYPE_EMAIL
See Also:
Constant Field Values

LOGICAL_TYPE_PHONE

public static final java.lang.String LOGICAL_TYPE_PHONE
See Also:
Constant Field Values

LOGICAL_TYPE_IMAGE

public static final java.lang.String LOGICAL_TYPE_IMAGE
See Also:
Constant Field Values

LOGICAL_TYPE_URL

public static final java.lang.String LOGICAL_TYPE_URL
See Also:
Constant Field Values

LOGICAL_TYPE_DATETIME

public static final java.lang.String LOGICAL_TYPE_DATETIME
See Also:
Constant Field Values

LOGICAL_TYPE_DATE

public static final java.lang.String LOGICAL_TYPE_DATE
See Also:
Constant Field Values

LOGICAL_TYPE_ADDRESS

public static final java.lang.String LOGICAL_TYPE_ADDRESS
See Also:
Constant Field Values
Constructor Detail

LogicalType

public LogicalType(java.lang.String type)
This constructor will be used by general logical types that have nothing to do with PIM applications.

Parameters:
type - This is the non-PIM type of logical types. Valid values can be : LOGICAL_TYPE_EMAIL, LOGICAL_TYPE_PHONE, LOGICAL_TYPE_IMAGE, or LOGICAL_TYPE_DATETIME LOGICAL_TYPE_DATE

LogicalType

public LogicalType(int pimApplication,
                   int pimField,
                   int pimFieldAttribute)
This constructor will be used for Phone type.

Parameters:
pimApplication - The PIM application of which this logical type is for, eg. Contact, Event, Todo. Valid values can be one of those in @see com.sybase.uep.bobclient.constants.RIMPimConstants.
pimField - This is the ID of the field within the PIM application. Valid values are listed in javax.microedition.pim interfaces for ToDo, Event, Contact, and etc.
pimFieldAttribute - An attribute for differentiating the field when there are multiples of it. For example, a home phone vs a mobile phone, etc. Valid values are PIMItem.ATTR_NONE, Contact.ATTR_WORK, Contact.ATTR_HOME, Contact.ATTR_MOBILE, Contact.ATTR_PAGER, Contact.ATTR_FAX, Contact.ATTR_OTHER
See Also:
ToDo, Event, Contact

LogicalType

public LogicalType(int pimApplication,
                   int pimField,
                   int pimFieldAttribute,
                   int pimSubFieldAttribute)
This constructor will be used for Address and Name types that have multiple subfields.

Parameters:
pimApplication - The PIM application of which this logical type is for, eg. Contact, Event, Todo. Valid values can be one of those in @see com.sybase.uep.bobclient.constants.RIMPimConstants.
pimField - This is the ID of the field within the PIM application. Valid values are listed in javax.microedition.pim interfaces for ToDo, Event, Contact, and etc.
pimFieldAttribute - An attribute for differentiating the field when there are multiples of it. For example, a home phone vs a mobile phone, etc. Valid values are PIMItem.ATTR_NONE, Contact.ATTR_WORK, Contact.ATTR_HOME, Contact.ATTR_MOBILE, Contact.ATTR_PAGER, Contact.ATTR_FAX, Contact.ATTR_OTHER
pimSubFieldAttribute - Some fields like address and name are a composite of different subfields. This parameter tells which part of the field to which this logical type associates. Valid values are Contact.ADDR_COUNTRY, Contact.ADDR_EXTRA, Contact.ADDR_LOCALITY, Contact.ADDR_POBOX, Contact.ADDR_POSTALCODE, Contact.ADDR_REGION, Contact.ADDR_STREET, Contact.NAME_FAMILY, Contact.NAME_GIVEN, Contact.NAME_OTHER, Contact.NAME_PREFIX, Contact.NAME_SUFFIX
See Also:
ToDo, Event, Contact
Method Detail

getType

public java.lang.String getType()
Get the logical type

Returns:
Valid values can be : LOGICAL_TYPE_EMAIL, LOGICAL_TYPE_PHONE, or LOGICAL_TYPE_IMAGE

getPIMApplication

public int getPIMApplication()
Get the PIM application

Returns:
Valid values can be one of those in @see com.sybase.uep.bobclient.constants.RIMPimConstants.

getPIMField

public int getPIMField()
Get PIM Field

Returns:
int value of the PIM field

getPIMFieldAttribute

public int getPIMFieldAttribute()
Get PIM field attribute

Returns:
int value of the PIM field attribute

getPIMSubFieldAttribute

public int getPIMSubFieldAttribute()
Get PIM sub field attribute

Returns:
int value of the PIM sub field attribute

isImage

public boolean isImage()
Check to see if of image type

Returns:
true if image type

isImageType

public static boolean isImageType(LogicalType type)

isEmail

public boolean isEmail()
Check to see if this logical type is of email type

Returns:
true if of email type

isEmailType

public static boolean isEmailType(LogicalType type)

isPhone

public boolean isPhone()
Check to see if this logical type is of phone type

Returns:
true if of phone type

isPhoneType

public static boolean isPhoneType(LogicalType type)

isURL

public boolean isURL()
Check to see if this logical type is of url type

Returns:
true if of url type

isURLType

public static boolean isURLType(LogicalType type)

isPIMFieldDateTime

public boolean isPIMFieldDateTime()
Check to see if this logical type pim application field is of type date time

Returns:
true if of date time

isPIMFieldDateTimeType

public static boolean isPIMFieldDateTimeType(LogicalType type)

isPIMFieldDate

public boolean isPIMFieldDate()
Check to see if this logical type pim application field is of type date

Returns:
true if of date

isPIMFieldDateType

public static boolean isPIMFieldDateType(LogicalType type)

isPIMAddress

public boolean isPIMAddress()
Check to see if this logical type pim application field is of type address

Returns:
boolean

isPIMHomeAddress

public boolean isPIMHomeAddress()
Check to see if this logical type pim application field is of type home address

Returns:
boolean

isPIMWorkAddress

public boolean isPIMWorkAddress()
Check to see if this logical type pim application field is of type work address

Returns:
boolean