FileDocCategorySizeDatePackage
PIMFieldDescriptor.javaAPI DocphoneME MR2 API (J2ME)5156Wed May 02 18:00:28 BST 2007com.sun.kvem.midp.pim

PIMFieldDescriptor

public class PIMFieldDescriptor extends Object
Specification of a PIM field.

Fields Summary
private int
field
PIM: field.
private int
dataType
PIM: type.
private boolean
hasDefaultValue
PIM: is the default value present?
private Object
defaultValue
PIM: default value.
private String
label
PIM: label.
String[]
labelResources
PIM: label resources.
private long
attributes
PIM: attributes.
private int
maxValues
PIM: maximum number of values or -1 for unlimited data.
Constructors Summary
public PIMFieldDescriptor(int field, int dataType, boolean hasDefaultValue, Object defaultValue, String labelResource, String[] labelResources, long attributes, int maxValues)
Constructor: field initialization.

param
field ID
param
dataType type
param
hasDefaultValue is the default value present?
param
defaultValue default value of the field
param
labelResource label
param
labelResources array of label resources
param
attributes field attributes
param
maxValues maximum number of values or -1


        this.field = field;
        this.dataType = dataType;
        this.hasDefaultValue = hasDefaultValue;
        this.defaultValue = defaultValue;
        this.label = Configuration.getPropertyDefault(labelResource,
	    "Label_" + labelResource);
        this.labelResources = labelResources;
        this.attributes = attributes;
        this.maxValues = maxValues;
    
public PIMFieldDescriptor(int field, int dataType, boolean hasDefaultValue, Object defaultValue, String labelResource, long attributes, int maxValues)
Constructor: field initialization.

param
field ID
param
dataType type
param
hasDefaultValue is the default value present?
param
defaultValue default value of the field
param
labelResource label (labelResources = null)
param
attributes field attributes
param
maxValues maximum number of values or -1


        this(field, dataType, hasDefaultValue, defaultValue,
            labelResource, null, attributes, maxValues);
    
Methods Summary
public intgetDataType()
Gets field type.

return
the field type

        return dataType;
    
public java.lang.ObjectgetDefaultValue()
Gets the default value.

return
the default value

        return defaultValue;
    
public java.lang.StringgetElementlabel(int arrayElement)
Gets the label.

param
arrayElement index of label in labelResources array
return
the label

        return Configuration.getPropertyDefault(labelResources[arrayElement],
	    "Label_" + labelResources[arrayElement]);
    
public intgetField()
Gets field ID.

return
the field ID

        return field;
    
public java.lang.StringgetLabel()
Gets field label.

return
the field label

        return label;
    
public intgetMaximumValues()
Gets the maximum values.

return
the maximum values

        return maxValues;
    
public intgetStringArraySize()
Gets the length of array (type STRING_ARRAY).

return
the length of array

        return labelResources.length;
    
public longgetSupportedAttributes()
Gets the supported attributes.

return
the set of supported attributes

        return attributes;
    
public booleanhasDefaultValue()
Checks if the field has a default value?

return
true if the field has a default value?

        return hasDefaultValue;