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

ScalarPIMField

public class ScalarPIMField extends Object implements PIMField
Encapsulation of a single-value PIM field

Fields Summary
private Object
value
Current value of the field.
private int
attributes
Field attributes.
Constructors Summary
Methods Summary
public voidaddValue(int attributes, java.lang.Object value)
Adds a value to a PIM field.

param
attributes properties to update
param
value entry to be updated

        this.value = value;
        this.attributes = attributes;
    
private voidcheckIndex(int index)
Ensures that index is value value offset.

param
index offset for value

        if (index != 0) {
            throw new IndexOutOfBoundsException(String.valueOf(index));
        }
    
public booleancontainsData()
Checks if the field contains data.

return
true if field contains data

        return true;
    
public intgetAttributes(int index)
Gets the field attributes.

param
index element identifier
return
encoded attributes

        checkIndex(index);
        return attributes;
    
public java.lang.ObjectgetValue(int index)
Gets the value of the field.

param
index element index
return
field value

        return value;
    
public intgetValueCount()
Gets the number of value elements.

return
always returns 1

        return 1;
    
public booleanisScalar()
Checks if field has scalar value.

return
always returns true

        return true;
    
public voidremoveValue(int index)
Removes a value element.

param
index identifier for value to remove

    
public voidsetValue(int attributes, java.lang.Object value, int index)
Sets the value of the field.

param
attributes field attributes requested
param
value new value for field
param
index element identifier

        this.value = value;
        this.attributes = attributes;