Methods Summary |
---|
public abstract void | addCategory(java.lang.Object listHandle, java.lang.String category)Adds a category to the categories defined for a list.
|
public abstract void | closeList(java.lang.Object listHandle)Closes list.
|
public abstract java.lang.Object | commitListElement(java.lang.Object listHandle, java.lang.Object elementKey, byte[] element, java.lang.String[] categories)Commit a list element.
|
public java.lang.String | composeDate(long date)Converts date in milliseconds to yyyy-MM-dd string. // yyyy-MM-dd
Calendar local_calendar =
Calendar.getInstance();
Date cldc_date = new Date(date);
local_calendar.setTime(cldc_date);
String returnValue = Integer.toString(local_calendar.get(YEAR)) +
"-" + prefix_0(Integer.toString(local_calendar.get(MONTH)+1)) +
"-" + prefix_0(Integer.toString(local_calendar.get(DAY_OF_MONTH)));
return returnValue;
|
public java.lang.String | composeDate1(long date)Converts date in milliseconds to yyyymmdd string. // yyyymmdd
Date cldc_date = new Date(date);
Calendar local_calendar =
Calendar.getInstance();
local_calendar.setTime(cldc_date);
String returnValue = Integer.toString(local_calendar.get(YEAR)) +
prefix_0(Integer.toString(local_calendar.get(MONTH)+1)) +
prefix_0(Integer.toString(local_calendar.get(DAY_OF_MONTH)));
return returnValue;
|
public java.lang.String | composeDateTime(long date)Converts date/time in milliseconds to yyyyMMddTHHmmss. // yyyyMMddTHHmmss
Date cldc_date = new Date(date);
Calendar local_calendar =
Calendar.getInstance(TimeZone.getTimeZone("GMT"));
local_calendar.setTime(cldc_date);
local_calendar.setTimeZone(TimeZone.getDefault());
String returnValue = Integer.toString(local_calendar.get(YEAR)) +
prefix_0(Integer.toString(local_calendar.get(MONTH)+1)) +
prefix_0(Integer.toString(local_calendar.get(DAY_OF_MONTH)))
+ "T" +
prefix_0(Integer.toString(local_calendar.get(HOUR_OF_DAY))) +
prefix_0(Integer.toString(local_calendar.get(MINUTE))) +
prefix_0(Integer.toString(local_calendar.get(SECOND)));
return returnValue;
|
public abstract void | deleteCategory(java.lang.Object listHandle, java.lang.String category)Deletes a category from the categories defined for a list.
|
public abstract java.lang.String | getArrayElementLabel(java.lang.Object listHandle, int field, int arrayElement)Gets the array element label.
|
public abstract java.lang.String | getAttributeLabel(java.lang.Object listHandle, int attribute)Gets attribute label for the given field attribute.
|
public abstract java.lang.String[] | getCategories(java.lang.Object listHandle)Gets the set of categories defined for a list.
|
public abstract byte[] | getDefaultBinaryValue(java.lang.Object listHandle, int field)Gets the default byte[] value for the given field. This will
only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract boolean | getDefaultBooleanValue(java.lang.Object listHandle, int field)Gets the default boolean value for the given field. This will
only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract long | getDefaultDateValue(java.lang.Object listHandle, int field)Gets the default date value for the given field. This will only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract int | getDefaultIntValue(java.lang.Object listHandle, int field)Gets the default integer value for the given field. This will
only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract java.lang.String | getDefaultListName(int listType)Get the name of the default list for the given type.
|
public abstract java.lang.String[] | getDefaultStringArrayValue(java.lang.Object listHandle, int field)Gets the default String[] value for the given field. This will
only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract java.lang.String | getDefaultStringValue(java.lang.Object listHandle, int field)Gets the default string value for the given field. This will
only
return a valid value if hasDefaultValue(listType, field) returns true.
|
public abstract int | getFieldDataType(java.lang.Object listHandle, int field)Gets the data type of the field.
|
public abstract java.lang.String | getFieldLabel(java.lang.Object listHandle, int field)Gets the label of the field.
|
public static com.sun.kvem.midp.pim.PIMHandler | getInstance()Gets a handle to the current PIMHandler.
if (instance == null) {
String className = Configuration
.getProperty("javax.microedition.pim.handler");
if (className == null) {
className = "com.sun.kvem.midp.pim.PIMBridge";
}
boolean isExcThrown = false;
try {
instance = (PIMHandler) Class.forName(className).newInstance();
} catch (ClassNotFoundException e) {
isExcThrown = true;
} catch (Error e) {
isExcThrown = true;
} catch (IllegalAccessException e) {
isExcThrown = true;
} catch (InstantiationException e) {
isExcThrown = true;
}
if (isExcThrown) {
throw new Error("PIM handler could not be initialized.");
}
}
return instance;
|
public abstract byte[] | getListElement(java.lang.Object listHandle, java.lang.Object elementKey)Get the data for a list element.
|
public abstract java.lang.String[] | getListElementCategories(java.lang.Object listHandle, java.lang.Object elementKey)Get categories for the specified list element.
|
public abstract java.lang.Object[] | getListKeys(java.lang.Object listHandle)Get list element keys.
|
public abstract java.lang.String[] | getListNames(int listType)Get the supported list names for the given list type. All list elements
must be unique within the list.
|
public abstract int | getMaximumValues(java.lang.Object listHandle, int field)Get the maximum number of values that can be stored in the given field.
|
public abstract int | getStringArraySize(java.lang.Object listHandle, int field)Checks if size of the string array.
|
public abstract int[] | getSupportedArrayElements(java.lang.Object listHandle, int field)Gets the array of supported elements.
|
public abstract int[] | getSupportedAttributes(java.lang.Object listHandle, int field)Gets the supported attributes for the given field.
|
public abstract int | getSupportedAttributesMask(java.lang.Object listHandle, int field)Gets a mask containing all possible attributes for the given field.
|
public abstract int[] | getSupportedFields(java.lang.Object listHandle)Gets all fields that are supported in this list. All fields supported by
this list, including both standard and extended, are returned in this
array.
|
public abstract boolean | hasDefaultValue(java.lang.Object listHandle, int field)Checks if field has default value.
|
public abstract boolean | isSupportedArrayElement(java.lang.Object listHandle, int field, int arrayElement)Checks if the array element is supported.
|
public abstract boolean | isSupportedAttribute(java.lang.Object listHandle, int field, int attribute)Checks if attribute is supported.
|
public abstract boolean | isSupportedField(java.lang.Object listHandle, int field)Checks if field is supported in list.
|
public abstract java.lang.Object | openList(int listType, java.lang.String listName, int openMode)Opens list.
|
public long | parseDate(java.lang.String s)Converts date in format yyyy-MM-dd or yyyyMMdd to milliseconds.
Calendar local_calendar =
Calendar.getInstance();
// reset calendar to the state it is in composeDate method to get
// the same values for hours, minutes, seconds and milliseconds.
Date cldc_date = new Date(0);
local_calendar.setTime(cldc_date);
int year, month, day;
if (s.indexOf('-") != -1) { // yyyy-MM-dd
year = Integer.parseInt(s.substring(0, 4));
month = Integer.parseInt(s.substring(5, 7));
day = Integer.parseInt(s.substring(8, 10));
} else { // yyyyMMdd
year = Integer.parseInt(s.substring(0, 4));
month = Integer.parseInt(s.substring(4, 6));
day = Integer.parseInt(s.substring(6, 8));
}
local_calendar.set(Calendar.YEAR, year);
local_calendar.set(Calendar.MONTH, month - 1);
local_calendar.set(Calendar.DAY_OF_MONTH, day);
return (local_calendar.getTime()).getTime();
|
public long | parseDateTime(java.lang.String s)Converts date/time in format yyyyMMddTHHmmss(Z) to milliseconds.
Calendar local_calendar;
if (s.length() > 15 &&
s.charAt(15) == 'Z") { // absolute time
local_calendar =
Calendar.getInstance(TimeZone.getTimeZone("GMT"));
} else {
local_calendar =
Calendar.getInstance();
}
int year, month, day, hour, min, sec; // yyyyMMddTHHmmss
year = Integer.parseInt(s.substring(0, 4));
month = Integer.parseInt(s.substring(4, 6));
day = Integer.parseInt(s.substring(6, 8));
hour = Integer.parseInt(s.substring(9, 11));
min = Integer.parseInt(s.substring(11, 13));
sec = Integer.parseInt(s.substring(13, 15));
local_calendar.set(Calendar.YEAR, year);
local_calendar.set(Calendar.MONTH, month - 1);
local_calendar.set(Calendar.DAY_OF_MONTH, day);
local_calendar.set(Calendar.HOUR_OF_DAY, hour);
local_calendar.set(Calendar.MINUTE, min);
local_calendar.set(Calendar.SECOND, sec);
local_calendar.set(Calendar.MILLISECOND, 0);
return (local_calendar.getTime()).getTime();
|
private java.lang.String | prefix_0(java.lang.String str)Adds the "0" prefix to one-digit number in string representation.
String returnValue = "";
if (str.length() < 2) { // x convert to 0x
returnValue = "0";
}
returnValue += str;
return returnValue;
|
public abstract void | renameCategory(java.lang.Object listHandle, java.lang.String currentCategory, java.lang.String newCategory)Rename a category.
|