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

VectorPIMField

public class VectorPIMField extends Object implements PIMField
Encapsulation of a multi-value PIM field

Fields Summary
private final Vector
values
Array of values.
private final Vector
attributes
Array of 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.values.addElement(value);
        this.attributes.addElement(new Integer(attributes));
    
public booleancontainsData()
Checks if the field contains data.

return
true if field contains data

        return values.size() > 0;
    
public intgetAttributes(int index)
Gets the field attributes.

param
index element identifier
return
encoded attributes

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

param
index element index
return
field value

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

return
always returns 1

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

return
always returns true

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

param
index identifier for value to remove

        this.values.removeElementAt(index);
        this.attributes.removeElementAt(index);
    
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.values.setElementAt(value, index);
        this.attributes.setElementAt(new Integer(attributes), index);