com.waveset.object
Class AttributeValues

java.lang.Object
  extended bycom.waveset.object.AttributeValues

public class AttributeValues
extends java.lang.Object

Wraps 2 Vectors to provide to and from XML methods for attribute values. Attribute values contain a value and a type (parallel vectors). Special case the one value, string type for efficiency.


Field Summary
protected static Trace _trace
           
static java.lang.String code_id
           
 
Constructor Summary
AttributeValues()
           
AttributeValues(org.w3c.dom.Element e)
           
AttributeValues(int initialCapacity)
           
AttributeValues(int initialCapacity, int capacityIncrement)
           
 
Method Summary
protected  void add(java.lang.Integer index, java.lang.String type, java.lang.Object value)
           
 void add(int index, java.lang.String type, java.lang.Object value)
          Adds a value with specified type to the vector at a specified position.
 void add(java.lang.String type, java.lang.Object value)
          Adds a value with specified type to the vector.
 void add(Syntax syntax, java.lang.Object value)
          Adds a value with specified syntax to the vector.
 void addValueAttributes(java.lang.StringBuffer buf, boolean includeType)
           
 java.lang.String asString(java.lang.String delim, boolean includeEncrypted)
          Creates a string that represents the value of this attribute.
 void clear()
           
 boolean contains(java.lang.Object elem)
           
 boolean containsIgnoreCase(java.lang.Object elem)
           
 java.lang.Object get(int index)
           
 java.lang.String getAsString(int index)
           
 java.lang.Object getType(int index)
           
 void parseXml(org.w3c.dom.Element e)
           
 void set(int index, java.lang.String type, java.lang.Object value)
           
 void set(int index, Syntax syntax, java.lang.Object value)
          For now, just wrap a call to the string-arg flavor.
 int size()
           
 java.lang.Object[] toArray()
          Return an array of the values - special case the null vector and return a zero sized array for historical reasons.
 java.lang.String toString()
           
 java.lang.String toXml(int indent)
           
 void toXml(java.lang.StringBuffer buf, int indent)
           
 java.lang.Object[] typesToArray()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

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

_trace

protected static final Trace _trace
Constructor Detail

AttributeValues

public AttributeValues()

AttributeValues

public AttributeValues(int initialCapacity)

AttributeValues

public AttributeValues(int initialCapacity,
                       int capacityIncrement)

AttributeValues

public AttributeValues(org.w3c.dom.Element e)
                throws WavesetException
Method Detail

toString

public final java.lang.String toString()

asString

public java.lang.String asString(java.lang.String delim,
                                 boolean includeEncrypted)
Creates a string that represents the value of this attribute.

Parameters:
delim - - delimiter to use in the returned string for multivalued attributes
includeEncrypted - - include encrypted values in the retuned string
Returns:
the values as a string with the values delimited by the string that is passed in. If the value is not multi-valued, return a single value with no delimiters. Can return null.

add

public final void add(int index,
                      java.lang.String type,
                      java.lang.Object value)
Adds a value with specified type to the vector at a specified position.


add

public final void add(java.lang.String type,
                      java.lang.Object value)
Adds a value with specified type to the vector.


add

protected final void add(java.lang.Integer index,
                         java.lang.String type,
                         java.lang.Object value)

add

public final void add(Syntax syntax,
                      java.lang.Object value)
Adds a value with specified syntax to the vector.


size

public final int size()

get

public final java.lang.Object get(int index)

getAsString

public final java.lang.String getAsString(int index)

set

public final void set(int index,
                      Syntax syntax,
                      java.lang.Object value)
For now, just wrap a call to the string-arg flavor.


set

public final void set(int index,
                      java.lang.String type,
                      java.lang.Object value)

toArray

public final java.lang.Object[] toArray()
Return an array of the values - special case the null vector and return a zero sized array for historical reasons.


clear

public final void clear()

contains

public final boolean contains(java.lang.Object elem)

containsIgnoreCase

public final boolean containsIgnoreCase(java.lang.Object elem)

getType

public final java.lang.Object getType(int index)

typesToArray

public final java.lang.Object[] typesToArray()

parseXml

public final void parseXml(org.w3c.dom.Element e)
                    throws WavesetException
Throws:
WavesetException

toXml

public final java.lang.String toXml(int indent)

toXml

public final void toXml(java.lang.StringBuffer buf,
                        int indent)

addValueAttributes

public final void addValueAttributes(java.lang.StringBuffer buf,
                                     boolean includeType)