com.bloomberglp.blpapi
Class Element

java.lang.Object
  extended by com.bloomberglp.blpapi.Element
All Implemented Interfaces:
java.lang.Cloneable

public abstract class Element
extends java.lang.Object
implements java.lang.Cloneable

Elements are used to represent all data sent to/received from API services.

Using "Element" objects

An element is a variant type. That is they can represent any of the data types supported by the blpapi. Elements can represent simple scalar values like (float, string), arrays of simple types, complex values (sequences/choices), and arrays of complex values.

Accessing Elements

Elements are used when accessing messages received from the API, and when preparing requests for API services. There are two classes of accessor/manipulators that are used to access/manipulate elements. When accessing simple values and arrays, the "getValueAsX" family of functions are used where 'X' is the target data type(e.g., "getValueAsInt32"). For simplicity, all "getValueAsX" functions can optionally be supplied with an index parameter to access elements of an array. For scalar elements, index should not be supplied, or zero should be supplied. The following are examples of accessing simple and array elements.

This example shows how to access the value of a scalar element as an integer number. Then goes on to show how to access the same element as a String


 Element e;

 ...

 int x = e.getValueAsIn32();

 System.out.println(e.getValueAsString());

 (or)

 System.out.println(e.getValueAsString(0));
 

The following example shows how to access array elements


 int count = e.numValues();
 for (int i = 0; i < count; ++i) {
     System.out.println(e.getValueAsString(i));
 }
 

Use numValues() to determine the number of values available. For scalar values, it will return either 0 or 1. For arrays it will return the actual number of values in the array.

Complex elements contain named sub-elements. Sub-elements are accessed using the "getElement" and "getElementAsX" accessor functions. To demonstrate, the following example, shows how to access the "city" sub-element of an "address" element:

 Element address;
 ...
 address.getElement("city");
 

The following example retrieves the value of the "city" sub-element as a string value. address.getElementAsString("city");

To determine the number of available sub elements in a given element, the "numElements" accessor can be used. To retrieve the Nth available sub-element of a complex element, the "getElement(int)" accessor can be used. For example:


 int numElements = address.numElements();
 for (int i = 0; i < numElements; ++i) {
     Element e = address.getElement(i);
     System.out.println(e.name() + " = " + e.getValueAsString());
 }
 

Manipulating Elements

Elements are also used to submit input for API services (e.g., preparing a reference data request). Just as when accessing element values, there are two types of manipulators used to set elements. To set the value of simple elements, and arrays of simple elements, the "setValue", and "appendValue" manipulator are used. For example


 Request request;
 ...
 Element security = request.getElement("security");
 security.setValue("IBM UN Equity");

 Element fields = request.getElement("fields");
 fields.appendValue("DS003");
 fields.appendValue("PX_LAST");
 
To directly set named sub-elements, use the "setElement" manipulator:

request.setElement("security", "IBM UN Equity");

Methods which specify a Element name come in two forms. One which takes a Name as a parameter and one which takes a String. The form which takes Name is more efficient. However, it requires the Name to have been created in the global name table.

Type Conversions

The API will convert data types as long as there is no loss of precision involved. So
- A BOOL can be returned as bool, char, Int32, Int64, Float32, Float64, String (the string will be "true" or "false")
- A BOOL can be set from bool, String (if it has a value of "y", "n", "yes", "no", "true" or "false")
- A CHAR can be returned as char, Int32, Int64, Float32, Float64, String
- A CHAR can be set from char
- An INT32 can be returned as Int32, Int64, Float64, String
- An INT32 can be set from char, Int32
- An INT64 can be returned as Int64, String
- An INT64 can be set from char, Int32, Int64
- A FLOAT32 can be returned as Float32, Float64, String
- A FLOAT32 can be set from char, Float32
- A FLOAT64 can be returned as Float64, String
- A FLOAT64 can be set from char, Float32, Float64

Author:
Chao Yao(cyao3), Siva Somu(ssomu)

Constructor Summary
Element()
           
 
Method Summary
abstract  Element appendElement()
          If this Element is an array of Sequence or Choice Elements append a default initialized element to this element and return the appended element
abstract  void appendValue(boolean value)
          Append the specified value to this array element
abstract  void appendValue(byte[] value)
          Append the specified value to this array element
abstract  void appendValue(char value)
          Append the specified value to this array element
abstract  void appendValue(Constant value)
          Append the specified value to this array element
abstract  void appendValue(Datetime value)
          Append the specified value to this array element
abstract  void appendValue(double value)
          Append the specified value to this array element
abstract  void appendValue(float value)
          Append the specified value to this array element
abstract  void appendValue(int value)
          Append the specified value to this array element
abstract  void appendValue(long value)
          Append the specified value to this array element
abstract  void appendValue(Name value)
          Append the specified Constant value to this array element
abstract  void appendValue(java.lang.String value)
          Append the specified value to this array element
abstract  java.lang.Object clone()
           
abstract  Schema.Datatype datatype()
          Returns the Datatype of this Element
abstract  SchemaElementDefinition elementDefinition()
          Return a reference to the read-only element definition object that defines the properties of this elements value.
 ElementIterator elementIterator()
          Return an iterator for iterating over elements of this Sequence or Choice
abstract  Constant findConstant(ConstantsList constantsList)
           
abstract  Constant findConstant(ConstantsList constantsList, int index)
           
abstract  Element getChoice()
           
abstract  Element getElement(int position)
          Return the element at the specified zero based position.
abstract  Element getElement(Name name)
          Return the named sub-element, creating it if it doesn't exist if this element is modifiable
abstract  Element getElement(java.lang.String name)
          Return the named sub-element, creating it if it doesn't exist if this element is modifiable
abstract  boolean getElementAsBool(Name name)
          Returns the value of the named sub-element as a boolean
abstract  boolean getElementAsBool(java.lang.String name)
          Returns the value of the named sub-element as a boolean
abstract  byte[] getElementAsBytes(Name name)
          Returns the value of the named sub-element as a byte array
abstract  byte[] getElementAsBytes(java.lang.String name)
          Returns the value of the named sub-element as a byte array
abstract  char getElementAsChar(Name name)
          Returns the value of the named sub-element as a char
abstract  char getElementAsChar(java.lang.String name)
          Returns the value of the named sub-element as a char
abstract  Datetime getElementAsDate(Name name)
          Returns the value of the named sub-element as a Date
abstract  Datetime getElementAsDate(java.lang.String name)
          Returns the value of the named sub-element as a Date
abstract  Datetime getElementAsDatetime(Name name)
          Returns the value of the named sub-element as a Datetime
abstract  Datetime getElementAsDatetime(java.lang.String name)
          Returns the value of the named sub-element as a Datetime
abstract  float getElementAsFloat32(Name name)
          Returns the value of the named sub-element as a float
abstract  float getElementAsFloat32(java.lang.String name)
          Returns the value of the named sub-element as a float
abstract  double getElementAsFloat64(Name name)
          Returns the value of the named sub-element as a double
abstract  double getElementAsFloat64(java.lang.String name)
          Returns the value of the named sub-element as a double
abstract  int getElementAsInt32(Name name)
          Returns the value of the named sub-element as a int
abstract  int getElementAsInt32(java.lang.String name)
          Returns the value of the named sub-element as a int
abstract  long getElementAsInt64(Name name)
          Returns the value of the named sub-element as a long
abstract  long getElementAsInt64(java.lang.String name)
          Returns the value of the named sub-element as a int
abstract  Name getElementAsName(Name name)
          Returns the value of the named sub-element as the name of a constant.
abstract  Name getElementAsName(java.lang.String name)
          Returns the value of the named sub-element as the name of a constant.
abstract  java.lang.String getElementAsString(Name name)
          Returns the value of the named sub-element as a String
abstract  java.lang.String getElementAsString(java.lang.String name)
          Returns the value of the named sub-element as a String
abstract  Datetime getElementAsTime(Name name)
          Returns the value of the named sub-element as a Time
abstract  Datetime getElementAsTime(java.lang.String name)
          Returns the value of the named sub-element as a Time
abstract  boolean getValueAsBool()
          Returns the value of this element as a boolean
abstract  boolean getValueAsBool(int index)
          Returns the value of the element at the specified index as a boolean
abstract  byte[] getValueAsBytes()
          Returns the value of this element as a byte array
abstract  byte[] getValueAsBytes(int index)
          Returns the value of the element at the specified index as a byte array
abstract  char getValueAsChar()
          Returns the value of this element as a char
abstract  char getValueAsChar(int index)
          Returns the value of the element at the specified index as a char
abstract  Datetime getValueAsDate()
          Returns the value of this element as a Date
abstract  Datetime getValueAsDate(int index)
          Returns the value of the element at the specified index as a Date
abstract  Datetime getValueAsDatetime()
          Returns the value of this element as a Datetime
abstract  Datetime getValueAsDatetime(int index)
          Returns the value of the element at the specified index as a Datetime
abstract  Element getValueAsElement()
          Returns the value of this element as an Element
abstract  Element getValueAsElement(int index)
          Returns the value at the specified index in this element as an Element
abstract  Constant getValueAsEnumeration()
          Returns the value of this element as a Enumeration constant
abstract  Constant getValueAsEnumeration(int index)
          Returns the value of the element at the specified index as a Enumeration constant
abstract  float getValueAsFloat32()
          Returns the value of this element as a float
abstract  float getValueAsFloat32(int index)
          Returns the value of the element at the specified index as a float
abstract  double getValueAsFloat64()
          Returns the value of this element as a double
abstract  double getValueAsFloat64(int index)
          Returns the value of the element at the specified index as a double
abstract  int getValueAsInt32()
          Returns the value of this element as a int
abstract  int getValueAsInt32(int index)
          Returns the value of the element at the specified index as a int
abstract  long getValueAsInt64()
          Returns the value of this element as a long
abstract  long getValueAsInt64(int index)
          Returns the value of the element at the specified index as a long
abstract  Name getValueAsName()
          Returns the value of this element as a Enumeration constant
abstract  Name getValueAsName(int index)
          Returns the value of the element at the specified index as a Enumeration constant
abstract  java.lang.String getValueAsString()
          Returns the value of this element as a String
abstract  java.lang.String getValueAsString(int index)
          Returns the value of the element at the specified index as a String
abstract  Datetime getValueAsTime()
          Returns the value of this element as a Time
abstract  Datetime getValueAsTime(int index)
          Returns the value of the element at the specified index as a Time
abstract  boolean hasElement(Name name)
          Returns true if this element contains an element with the specified name Same as calling hasElement(name, false)
abstract  boolean hasElement(Name name, boolean excludeNullElements)
          Returns true if this element contains an element with the specified name
abstract  boolean hasElement(java.lang.String name)
          Returns true if this element contains an element with the specified name Same as calling hasElement(name, false
abstract  boolean hasElement(java.lang.String name, boolean excludeNullElements)
          Returns true if this element contains an element with the specified name
abstract  boolean isArray()
          Returns true if this element is an array
abstract  boolean isComplexType()
          Returns if this element is a complex type
abstract  boolean isEqualTo(Constant constant)
           
abstract  boolean isEqualTo(Constant constant, int index)
          Return true if the value at the specified index of this element is equal to the specified constant
abstract  boolean isNull()
          Returns true if this element is null.
abstract  boolean isNullValue(int position)
          Returns true if the element at the specified position in a Sequence or choice element is null.
abstract  boolean isReadOnly()
          Returns true if this element cannot be modified
abstract  Name name()
          Return the name of this Element
abstract  int numElements()
          Return the number of elements this element contains
abstract  int numValues()
          Return the number of values this element contains
abstract  void print(java.io.OutputStream output)
          Prints the contents of this element to the specified OutputStream.
abstract  void print(java.io.Writer writer)
          Prints the contents of this element to the specified Writer.
abstract  Element setChoice(Name name)
          Set the named sub-element as the choice's selection
abstract  Element setChoice(java.lang.String name)
          Set the named sub-element as the choice's selection
abstract  void setElement(Name name, boolean value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, byte[] value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, char value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, Constant value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, Datetime value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, double value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, float value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, int value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, long value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, Name value)
          Set the named sub-element to the specified value
abstract  void setElement(Name name, java.lang.String value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, boolean value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, byte[] value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, char value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, Constant value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, Datetime value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, double value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, float value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, int value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, long value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, Name value)
          Set the named sub-element to the specified value
abstract  void setElement(java.lang.String name, java.lang.String value)
          Set the named sub-element to the specified value
abstract  void setValue(boolean value)
          Set the value of this element to the specified value.
abstract  void setValue(boolean value, int index)
          Set the value of the element at the specified index to the specified value
abstract  void setValue(byte[] value)
          Set the value of this element to the specified value.
abstract  void setValue(byte[] value, int index)
          Set the value of this element to the specified value
abstract  void setValue(char value)
          Set the value of this element to the specified value.
abstract  void setValue(char value, int index)
          Set the value of this element to the specified value
abstract  void setValue(Constant constant)
          Set the value of this element to the specified value.
abstract  void setValue(Constant constant, int index)
          Set the value of this element to the specified value
abstract  void setValue(Datetime value)
          Set the value of this element to the specified value.
abstract  void setValue(Datetime value, int index)
          Set the value of this element to the specified value
abstract  void setValue(double value)
          Set the value of this element to the specified value.
abstract  void setValue(double value, int index)
          Set the value of this element to the specified value
abstract  void setValue(float value)
          Set the value of this element to the specified value.
abstract  void setValue(float value, int index)
          Set the value of this element to the specified value
abstract  void setValue(int value)
          Set the value of this element to the specified value.
abstract  void setValue(int value, int index)
          Set the value of this element to the specified value
abstract  void setValue(long value)
          Set the value of this element to the specified value.
abstract  void setValue(long value, int index)
          Set the value of this element to the specified value
abstract  void setValue(Name constant)
          Set the value of this element to the specified value.
abstract  void setValue(Name constant, int index)
          Set the value of this element to the specified constant value
abstract  void setValue(java.lang.String value)
          Set the value of this element to the specified value.
abstract  void setValue(java.lang.String value, int index)
          Set the value of this element to the specified value
abstract  java.lang.String toString()
          Returns the contents of this element as a String
abstract  SchemaTypeDefinition typeDefinition()
          Returns the SchemaTypeDefinition for this element.
abstract  boolean valueIsNull(int position)
          Deprecated. As of 3.2.1, replaced by isNullValue(int)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Element

public Element()
Method Detail

name

public abstract Name name()
Return the name of this Element

If this Element is part of a sequence or choice Element then this returns the Name of this Element within the sequence or choice Element that owns it. If this Element is not part of a sequence Element (that is it is an entire Request or Message) then the Name of the Request or Message is returned


datatype

public abstract Schema.Datatype datatype()
Returns the Datatype of this Element

Equivalent to calling elementDefinition(). typeDefinition(). datatype()


isArray

public abstract boolean isArray()
Returns true if this element is an array

Returns true if elementDefinition().maxValues() > 1 or if elementDefinition().maxValues() == SchemaElementDefinition.UNBOUNDED

Returns:
true if this element is an array and false otherwise

isComplexType

public abstract boolean isComplexType()
Returns if this element is a complex type

returns true if datatype() == Schema.Datatype.SEQUENCE

Returns:
true if this element is a complex type false otherwise

isReadOnly

public abstract boolean isReadOnly()
Returns true if this element cannot be modified

Please note that calling setters on a readonly element will cause an UnsupportedOperationException to be thrown


elementDefinition

public abstract SchemaElementDefinition elementDefinition()
Return a reference to the read-only element definition object that defines the properties of this elements value.


typeDefinition

public abstract SchemaTypeDefinition typeDefinition()
Returns the SchemaTypeDefinition for this element.

This is equivalent to calling elementDefinition().datatype()


numValues

public abstract int numValues()
Return the number of values this element contains

The return value from this function is always >= 0. For scalar elements this function returns 1 or 0. For arrays this function returns the actual number of values in the array.


numElements

public abstract int numElements()
Return the number of elements this element contains

Elements for which isComplexType() is false always return 0 Choice elements always return 1. Sequence elements return the actual number of elements they contain.


isNull

public abstract boolean isNull()
Returns true if this element is null.

For arrays this function always returns false else this is same as testing == 0

Returns:
true if this element is null. false otherwise

valueIsNull

public abstract boolean valueIsNull(int position)
Deprecated. As of 3.2.1, replaced by isNullValue(int)

Returns true if the element at the specified position in a Sequence or choice element is null.

Parameters:
position - identifies the position of the element that is being tested
Returns:
true if the element at the specified position is null
Throws:
NotFoundException - if position >= numElements()

isNullValue

public abstract boolean isNullValue(int position)
Returns true if the element at the specified position in a Sequence or choice element is null.

Parameters:
position - identifies the position of the element that is being tested
Returns:
true if the element at the specified position is null
Throws:
NotFoundException - if position >= numElements()

isEqualTo

public abstract boolean isEqualTo(Constant constant)
Returns:
true if the value this element is equal to the specified constant

isEqualTo

public abstract boolean isEqualTo(Constant constant,
                                  int index)
Return true if the value at the specified index of this element is equal to the specified constant

Parameters:
constant - the Constant which is being compared
index - the Index of the value in this element that the constant is being compared to.
Throws:
java.lang.IndexOutOfBoundsException - if index >= numValues()

findConstant

public abstract Constant findConstant(ConstantsList constantsList)
Parameters:
constantsList -
Throws:
java.lang.IndexOutOfBoundsException
NotFoundException

findConstant

public abstract Constant findConstant(ConstantsList constantsList,
                                      int index)
Parameters:
constantsList -
index -
Throws:
NotFoundException
java.lang.IndexOutOfBoundsException

getValueAsElement

public abstract Element getValueAsElement()
Returns the value of this element as an Element

Same as calling getValueAsElement(0)

Returns:
the value of this element as an Element
Throws:
InvalidConversionException - if the value of this element cannot be converted to an Element
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsElement(int)

getValueAsElement

public abstract Element getValueAsElement(int index)
Returns the value at the specified index in this element as an Element

Applicable only for an array of Sequence or Choice elements.

Parameters:
index - of the Element that is requested
Returns:
the value at the specified index in this element as an Element
Throws:
java.lang.IndexOutOfBoundsException - if the specified index >= numValues()
InvalidConversionException - if this element is not an array of Sequence or Choice elements

getValueAsBool

public abstract boolean getValueAsBool()
Returns the value of this element as a boolean

Same as calling getValueAsBool(0)

Returns:
the value of this element as a boolean
Throws:
InvalidConversionException - if the value of this element cannot be converted to a boolean
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsBool(int)

getValueAsBool

public abstract boolean getValueAsBool(int index)
Returns the value of the element at the specified index as a boolean

If the datatype of the element at the specified index is not boolean this method attempts to convert it to a boolean.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a boolean
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a boolean
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsChar

public abstract char getValueAsChar()
Returns the value of this element as a char

Same as calling getValueAsChar(0)

Returns:
the value of this element as a char
Throws:
InvalidConversionException - if the value of this element cannot be converted to a char
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsChar(int)

getValueAsChar

public abstract char getValueAsChar(int index)
Returns the value of the element at the specified index as a char

If the datatype of the element at the specified index is not char this method attempts to convert it to a char.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a char
Throws:
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsInt32

public abstract int getValueAsInt32()
Returns the value of this element as a int

Same as calling getValueAsInt32(0)

Returns:
the value of this element as a int
Throws:
InvalidConversionException - if the value of this element cannot be converted to a int
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsInt32(int)

getValueAsInt32

public abstract int getValueAsInt32(int index)
Returns the value of the element at the specified index as a int

If the datatype of the element at the specified index is not int this method attempts to convert it to a int.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a int
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a int
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsInt64

public abstract long getValueAsInt64()
Returns the value of this element as a long

Same as calling getValueAsInt64(0)

Returns:
the value of this element as a long
Throws:
InvalidConversionException - if the value of this element cannot be converted to a long
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsInt64(int)

getValueAsInt64

public abstract long getValueAsInt64(int index)
Returns the value of the element at the specified index as a long

If the datatype of the element at the specified index is not long this method attempts to convert it to a long.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a long
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a long
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsFloat64

public abstract double getValueAsFloat64()
Returns the value of this element as a double

Same as calling getValueAsFloat64(0)

Returns:
the value of this element as a double
Throws:
InvalidConversionException - if the value of this element cannot be converted to a double
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsFloat64(int)

getValueAsFloat64

public abstract double getValueAsFloat64(int index)
Returns the value of the element at the specified index as a double

If the datatype of the element at the specified index is not double this method attempts to convert it to a double.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a double
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a double
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsFloat32

public abstract float getValueAsFloat32()
                                 throws InvalidConversionException
Returns the value of this element as a float

Same as calling getValueAsFloat32(0)

Returns:
the value of this element as a float
Throws:
InvalidConversionException - if the value of this element cannot be converted to a float
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsFloat32(int)

getValueAsFloat32

public abstract float getValueAsFloat32(int index)
Returns the value of the element at the specified index as a float

If the datatype of the element at the specified index is not float this method attempts to convert it to a float.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a float
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a float
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsString

public abstract java.lang.String getValueAsString()
Returns the value of this element as a String

Same as calling getValueAsString(0)

Returns:
the value of this element as a String
Throws:
InvalidConversionException - if the value of this element cannot be converted to a String
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsString(int)

getValueAsString

public abstract java.lang.String getValueAsString(int index)
Returns the value of the element at the specified index as a String

If the datatype of the element at the specified index is not String this method attempts to convert it to a String.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a String
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a String
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsBytes

public abstract byte[] getValueAsBytes()
Returns the value of this element as a byte array

Same as calling getValueAsBytes(0)

Returns:
the value of this element as a byte array
Throws:
InvalidConversionException - if the value of this element cannot be converted to a byte array
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsBytes(int)

getValueAsBytes

public abstract byte[] getValueAsBytes(int index)
Returns the value of the element at the specified index as a byte array

If the datatype of the element at the specified index is not byte array this method attempts to convert it to a byte array.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a byte array
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a byte array
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsDatetime

public abstract Datetime getValueAsDatetime()
Returns the value of this element as a Datetime

Same as calling getValueAsDatetime(0)

Returns:
the value of this element as a Datetime
Throws:
InvalidConversionException - if the value of this element cannot be converted to a Datetime
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsDatetime(int)

getValueAsDatetime

public abstract Datetime getValueAsDatetime(int index)
Returns the value of the element at the specified index as a Datetime

If the datatype of the element at the specified index is not Datetime this method attempts to convert it to a Datetime.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a Datetime
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a Datetime
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsDate

public abstract Datetime getValueAsDate()
Returns the value of this element as a Date

Same as calling getValueAsDate(0)

Returns:
the value of this element as a Date
Throws:
InvalidConversionException - if the value of this element cannot be converted to a Date
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsDate(int)

getValueAsDate

public abstract Datetime getValueAsDate(int index)
Returns the value of the element at the specified index as a Date

If the datatype of the element at the specified index is not Date this method attempts to convert it to a Date.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a Date
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a Date
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsTime

public abstract Datetime getValueAsTime()
Returns the value of this element as a Time

Same as calling getValueAsTime(0)

Returns:
the value of this element as a Time
Throws:
InvalidConversionException - if the value of this element cannot be converted to a Time
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsTime(int)

getValueAsTime

public abstract Datetime getValueAsTime(int index)
Returns the value of the element at the specified index as a Time

If the datatype of the element at the specified index is not Time this method attempts to convert it to a Time.

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a Time
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a Time
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsEnumeration

public abstract Constant getValueAsEnumeration()
Returns the value of this element as a Enumeration constant

Same as calling getValueAsEnumeration(0)

Returns:
the value of this element as a Enumeration constant
Throws:
InvalidConversionException - if the value of this element cannot be converted to an Enumeration
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsEnumeration(int)

getValueAsEnumeration

public abstract Constant getValueAsEnumeration(int index)
Returns the value of the element at the specified index as a Enumeration constant

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a Enumeration constant
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a Enumeration constant
java.lang.IndexOutOfBoundsException - if index >= numValues()

getValueAsName

public abstract Name getValueAsName()
Returns the value of this element as a Enumeration constant

Same as calling getValueAsName(0)

Returns:
the value of this element as a Enumeration constant
Throws:
InvalidConversionException - if the value of this element cannot be converted to an Enumeration
java.lang.IndexOutOfBoundsException - if numValues() == 0
See Also:
getValueAsEnumeration(int)

getValueAsName

public abstract Name getValueAsName(int index)
Returns the value of the element at the specified index as a Enumeration constant

Parameters:
index - the index of the element whose value is requested
Returns:
the value of the element at the specified index as a Enumeration constant
Throws:
InvalidConversionException - if the value of the element at the specified index cannot be converted to a Enumeration constant
java.lang.IndexOutOfBoundsException - if index >= numValues()

hasElement

public abstract boolean hasElement(Name name)
Returns true if this element contains an element with the specified name Same as calling hasElement(name, false)

Parameters:
name - the name of the element whose existence is being queried
Returns:
true if an element with the specified name exists
Throws:
java.lang.UnsupportedOperationException - if called on non complex type

hasElement

public abstract boolean hasElement(Name name,
                                   boolean excludeNullElements)
Returns true if this element contains an element with the specified name

Null elements are ignored if the excludeNullElements parameter is true. They are included otherwise

Returns:
true if an element with the specified name exists
Throws:
java.lang.UnsupportedOperationException - if called on non complex type

hasElement

public abstract boolean hasElement(java.lang.String name)
Returns true if this element contains an element with the specified name Same as calling hasElement(name, false

Parameters:
name - the name of the element whose existence is being queried
Returns:
true if an element with the specified name exists
Throws:
java.lang.UnsupportedOperationException - if called on non complex type

hasElement

public abstract boolean hasElement(java.lang.String name,
                                   boolean excludeNullElements)
Returns true if this element contains an element with the specified name

Null elements are ignored if the excludeNullElements parameter is true. They are included otherwise

Returns:
true if an element with the specified name exists
Throws:
java.lang.UnsupportedOperationException - if called on non complex type

getElement

public abstract Element getElement(int position)
Return the element at the specified zero based position.

The position is the zero based position of all sub-elements that are currently present in this element.

Parameters:
position -
Returns:
the element at the specified zero based position.
Throws:
NotFoundException - if position >= numElements()

getElement

public abstract Element getElement(Name name)
Return the named sub-element, creating it if it doesn't exist if this element is modifiable

This function looks up the named sub-element. If the name does not exist then as a convenience this method creates the sub-element (if the element is modifiable) and returns the newly created sub-element.

Parameters:
name - the name of the required sub-element
Returns:
the named sub-element
Throws:
NotFoundException - if the named sub-element is not available
java.lang.UnsupportedOperationException - if called on non complex type

getElement

public abstract Element getElement(java.lang.String name)
Return the named sub-element, creating it if it doesn't exist if this element is modifiable

This function looks up the named sub-element. If the name does not exist then as a convenience this method creates the sub-element (if the element is modifiable) and returns the newly created sub-element.

Parameters:
name - the name of the required sub-element
Returns:
the named sub-element
Throws:
NotFoundException - if the named sub-element is not available
java.lang.UnsupportedOperationException - if called on non complex type

getElementAsBool

public abstract boolean getElementAsBool(Name name)
Returns the value of the named sub-element as a boolean

same as calling getElement(Name).getValueAsBool()

Returns:
the value of the named sub-element as a boolean
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a boolean
java.lang.UnsupportedOperationException - if called on non complex type

getElementAsBool

public abstract boolean getElementAsBool(java.lang.String name)
Returns the value of the named sub-element as a boolean

same as calling getElement(String).getValueAsBool()

Returns:
the value of the named sub-element as a boolean
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a boolean
java.lang.UnsupportedOperationException - if called on non complex type

getElementAsChar

public abstract char getElementAsChar(Name name)
Returns the value of the named sub-element as a char

same as calling getElement(Name).getValueAsChar()

Returns:
the value of the named sub-element as a char
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a char

getElementAsChar

public abstract char getElementAsChar(java.lang.String name)
Returns the value of the named sub-element as a char

same as calling getElement(String).getValueAsChar()

Returns:
the value of the named sub-element as a char
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a char

getElementAsInt32

public abstract int getElementAsInt32(Name name)
Returns the value of the named sub-element as a int

same as calling getElement(Name).getValueAsInt32()

Returns:
the value of the named sub-element as a int
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a int

getElementAsInt32

public abstract int getElementAsInt32(java.lang.String name)
Returns the value of the named sub-element as a int

same as calling getElement(String).getValueAsInt32()

Returns:
the value of the named sub-element as a int
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a int

getElementAsInt64

public abstract long getElementAsInt64(Name name)
Returns the value of the named sub-element as a long

same as calling getElement(Name).getValueAsInt64()

Returns:
the value of the named sub-element as a long
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a long

getElementAsInt64

public abstract long getElementAsInt64(java.lang.String name)
Returns the value of the named sub-element as a int

same as calling getElement(String).getValueAsInt32()

Returns:
the value of the named sub-element as a long
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a long

getElementAsFloat64

public abstract double getElementAsFloat64(Name name)
Returns the value of the named sub-element as a double

same as calling getElement(Name).getValueAsFloat64()

Returns:
the value of the named sub-element as a double
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a double

getElementAsFloat64

public abstract double getElementAsFloat64(java.lang.String name)
Returns the value of the named sub-element as a double

same as calling getElement(String).getValueAsFloat64()

Returns:
the value of the named sub-element as a double
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a double

getElementAsFloat32

public abstract float getElementAsFloat32(Name name)
Returns the value of the named sub-element as a float

same as calling getElement(Name).getValueAsFloat32()

Returns:
the value of the named sub-element as a float
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a float

getElementAsFloat32

public abstract float getElementAsFloat32(java.lang.String name)
Returns the value of the named sub-element as a float

same as calling getElement(String).getValueAsFloat32()

Returns:
the value of the named sub-element as a float
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a float

getElementAsString

public abstract java.lang.String getElementAsString(Name name)
Returns the value of the named sub-element as a String

same as calling getElement(Name).getValueAsString()

Returns:
the value of the named sub-element as a String
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a String

getElementAsString

public abstract java.lang.String getElementAsString(java.lang.String name)
Returns the value of the named sub-element as a String

same as calling getElement(String).getValueAsString()

Returns:
the value of the named sub-element as a String
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a String

getElementAsBytes

public abstract byte[] getElementAsBytes(Name name)
Returns the value of the named sub-element as a byte array

same as calling getElement(Name).getValueAsBytes()

Returns:
the value of the named sub-element as a byte array
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a byte array

getElementAsBytes

public abstract byte[] getElementAsBytes(java.lang.String name)
Returns the value of the named sub-element as a byte array

same as calling getElement(String).getValueAsBytes()

Returns:
the value of the named sub-element as a byte array
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a byte array

getElementAsDatetime

public abstract Datetime getElementAsDatetime(Name name)
Returns the value of the named sub-element as a Datetime

same as calling getElement(Name).getValueAsDatetime()

Returns:
the value of the named sub-element as a Datetime
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Datetime

getElementAsDatetime

public abstract Datetime getElementAsDatetime(java.lang.String name)
Returns the value of the named sub-element as a Datetime

same as calling getElement(String).getValueAsDatetime()

Returns:
the value of the named sub-element as a Datetime
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Datetime

getElementAsDate

public abstract Datetime getElementAsDate(Name name)
Returns the value of the named sub-element as a Date

same as calling getElement(Name).getValueAsDate()

Returns:
the value of the named sub-element as a Date
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Date

getElementAsDate

public abstract Datetime getElementAsDate(java.lang.String name)
Returns the value of the named sub-element as a Date

same as calling getElement(String).getValueAsDate()

Returns:
the value of the named sub-element as a Date
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Date

getElementAsTime

public abstract Datetime getElementAsTime(Name name)
Returns the value of the named sub-element as a Time

same as calling getElement(Name).getValueAsTime()

Returns:
the value of the named sub-element as a Time
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Time

getElementAsTime

public abstract Datetime getElementAsTime(java.lang.String name)
Returns the value of the named sub-element as a Time

same as calling getElement(String).getValueAsTime()

Returns:
the value of the named sub-element as a Time
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Time

getElementAsName

public abstract Name getElementAsName(Name name)
Returns the value of the named sub-element as the name of a constant.

same as calling getElement(Name).getValueAsName()

Returns:
the value of the named sub-element as a Name
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Name

getElementAsName

public abstract Name getElementAsName(java.lang.String name)
Returns the value of the named sub-element as the name of a constant.

same as calling getElement(String).getValueAsName()

Returns:
the value of the named sub-element as a Name
Throws:
NotFoundException - if the named sub-element does not exist
InvalidConversionException - if the value of the named sub-element cannot be converted to a Name

getChoice

public abstract Element getChoice()

toString

public abstract java.lang.String toString()
Returns the contents of this element as a String

Overrides:
toString in class java.lang.Object

print

public abstract void print(java.io.OutputStream output)
                    throws java.io.IOException
Prints the contents of this element to the specified OutputStream.

Throws:
java.io.IOException

print

public abstract void print(java.io.Writer writer)
                    throws java.io.IOException
Prints the contents of this element to the specified Writer.

Throws:
java.io.IOException

clone

public abstract java.lang.Object clone()
Overrides:
clone in class java.lang.Object

appendElement

public abstract Element appendElement()
If this Element is an array of Sequence or Choice Elements append a default initialized element to this element and return the appended element

Returns:
returns the newly appended element
Throws:
java.lang.UnsupportedOperationException - if called on an element that is not an array of Sequence or Choice or if the element is not modifiable

appendValue

public abstract void appendValue(boolean value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(char value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(int value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(long value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(double value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(float value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(Datetime value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(Constant value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(Name value)
Append the specified Constant value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(java.lang.String value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

appendValue

public abstract void appendValue(byte[] value)
Append the specified value to this array element

Parameters:
value - the value to be appended to this array element
Throws:
java.lang.UnsupportedOperationException - if called on a non-array or if the element is read-only
InvalidConversionException - if the specified value cannot be converted to the data type of the array

setElement

public abstract void setElement(Name name,
                                boolean value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                boolean value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                char value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                char value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                int value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                int value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                long value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                long value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                double value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                double value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                float value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                float value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                Datetime value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                Datetime value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                Constant value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                Constant value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                Name value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                Name value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                java.lang.String value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                java.lang.String value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(Name name,
                                byte[] value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setElement

public abstract void setElement(java.lang.String name,
                                byte[] value)
Set the named sub-element to the specified value

Parameters:
name - the Name of the sub-element to set
value - the value to be set for the specified element
Throws:
NotFoundException - if the named sub-element cannot be found
InvalidConversionException - if the element specified by name cannot be initialized with the specified value.
java.lang.UnsupportedOperationException - if this element is not a sequence or choice or if this element is read-only

setChoice

public abstract Element setChoice(Name name)
Set the named sub-element as the choice's selection

Note that if this choice element already contains a selection it is discarded and the the choice's selection is set to the named sub-element

Parameters:
name - Name of the sub-element to set the choice to
Returns:
the reference to the specified selection
Throws:
NotFoundException - if the named sub-element cannot be found
java.lang.UnsupportedOperationException - if this element is not a choice or if this element is read-only

setChoice

public abstract Element setChoice(java.lang.String name)
Set the named sub-element as the choice's selection

Note that if this choice element already contains a selection it is discarded and the the choice's selection is set to the named sub-element

Parameters:
name - Name of the sub-element to set the choice to
Returns:
the reference to the specified selection
Throws:
NotFoundException - if the named sub-element cannot be found
java.lang.UnsupportedOperationException - if this element is not a choice or if this element is read-only

setValue

public abstract void setValue(boolean value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(boolean value,
                              int index)
Set the value of the element at the specified index to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(char value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(char value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(int value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(int value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(long value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(long value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(double value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(double value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(float value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(float value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(Datetime value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(Datetime value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(Constant constant)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(Constant constant,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(Name constant)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(Name constant,
                              int index)
Set the value of this element to the specified constant value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(java.lang.String value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(java.lang.String value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

setValue

public abstract void setValue(byte[] value)
Set the value of this element to the specified value. Same as calling setValue(value, 0)

Throws:
InvalidConversionException - if this element cannot be initialized with the specified value

setValue

public abstract void setValue(byte[] value,
                              int index)
Set the value of this element to the specified value

Throws:
InvalidConversionException - if the element at the specified index cannot be initialized with the specified value
java.lang.IndexOutOfBoundsException - if index >= numValues()

elementIterator

public ElementIterator elementIterator()
Return an iterator for iterating over elements of this Sequence or Choice



Copyright © 2015 Bloomberg L.P.. All Rights Reserved.