Class Element
- All Implemented Interfaces:
Cloneable
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:
private static final Name CITY = Name.getName("city");
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
private static final Name SECURITY = Name.getName("security");
private static final Name FIELDS = Name.getName("fields");
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");
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
- A BYTEARRAY is set from byte[] and is returned as byte[] ONLY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ElementIf this Element is an array of Sequence or Choice Elements append a default initialized element to this element and return the appended elementabstract voidappendValue(boolean value) Append the specified value to this array elementabstract voidappendValue(byte[] value) Deprecated.Arrays of byte arrays are not supported.abstract voidappendValue(char value) Append the specified value to this array elementabstract voidappendValue(double value) Append the specified value to this array elementabstract voidappendValue(float value) Append the specified value to this array elementabstract voidappendValue(int value) Append the specified value to this array elementabstract voidappendValue(long value) Append the specified value to this array elementabstract voidappendValue(Constant value) Append the specified value to this array elementabstract voidappendValue(Datetime value) Append the specified value to this array elementabstract voidappendValue(Name value) Append the specified Constant value to this array elementabstract voidappendValue(String value) Append the specified value to this array elementabstract Objectclone()abstract Schema.Datatypedatatype()Returns the Datatype of this Elementabstract SchemaElementDefinitionReturn a reference to the read-only element definition object that defines the properties of this elements value.Return an iterator for iterating over elements of this Sequence or Choiceabstract ConstantfindConstant(ConstantsList constantsList) Find and return a constant in the specified constantsList with the same value as this element.abstract ConstantfindConstant(ConstantsList constantsList, int index) Find and return a constant in the specified constantLists with the value stored in this element at the given indexabstract Elementabstract ElementgetElement(int position) Return the element at the specified zero based position.abstract ElementgetElement(Name name) Return the named sub-element, creating it if it doesn't exist if this element is modifiableabstract ElementgetElement(String name) Deprecated.UsegetElement(Name)instead.abstract booleangetElementAsBool(Name name) Returns the value of the named sub-element as a booleanabstract booleangetElementAsBool(String name) Deprecated.UsegetElementAsBool(Name)instead.abstract byte[]getElementAsBytes(Name name) Returns the value of the named sub-element as a byte arrayabstract byte[]getElementAsBytes(String name) Deprecated.UsegetElementAsBytes(Name)instead.abstract chargetElementAsChar(Name name) Returns the value of the named sub-element as a charabstract chargetElementAsChar(String name) Deprecated.UsegetElementAsChar(Name)instead.abstract DatetimegetElementAsDate(Name name) Returns the value of the named sub-element as a Dateabstract DatetimegetElementAsDate(String name) Deprecated.UsegetElementAsDate(Name)instead.abstract DatetimegetElementAsDatetime(Name name) Returns the value of the named sub-element as a Datetimeabstract DatetimegetElementAsDatetime(String name) Deprecated.UsegetElementAsDatetime(Name)instead.abstract floatgetElementAsFloat32(Name name) Returns the value of the named sub-element as a floatabstract floatgetElementAsFloat32(String name) Deprecated.UsegetElementAsFloat32(Name)instead.abstract doublegetElementAsFloat64(Name name) Returns the value of the named sub-element as a doubleabstract doublegetElementAsFloat64(String name) Deprecated.UsegetElementAsFloat64(Name)instead.abstract intgetElementAsInt32(Name name) Returns the value of the named sub-element as a intabstract intgetElementAsInt32(String name) Deprecated.UsegetElementAsInt32(Name)instead.abstract longgetElementAsInt64(Name name) Returns the value of the named sub-element as a longabstract longgetElementAsInt64(String name) Deprecated.UsegetElementAsInt64(Name)instead.abstract NamegetElementAsName(Name name) Returns the value of the named sub-element as the name of a constant.abstract NamegetElementAsName(String name) Deprecated.UsegetElementAsName(Name)instead.abstract StringgetElementAsString(Name name) Returns the value of the named sub-element as a Stringabstract StringgetElementAsString(String name) Deprecated.UsegetElementAsString(Name)instead.abstract DatetimegetElementAsTime(Name name) Returns the value of the named sub-element as a Timeabstract DatetimegetElementAsTime(String name) Deprecated.UsegetElementAsTime(Name)instead.abstract booleanReturns the value of this element as a booleanabstract booleangetValueAsBool(int index) Returns the value of the element at the specified index as a booleanabstract byte[]Returns the value of this element as a byte arrayabstract byte[]getValueAsBytes(int index) Returns the value of the element at the specified index as a byte arrayabstract charReturns the value of this element as a charabstract chargetValueAsChar(int index) Returns the value of the element at the specified index as a charabstract DatetimeReturns the value of this element as a Dateabstract DatetimegetValueAsDate(int index) Returns the value of the element at the specified index as a Dateabstract DatetimeReturns the value of this element as a Datetimeabstract DatetimegetValueAsDatetime(int index) Returns the value of the element at the specified index as a Datetimeabstract ElementReturns the value of this element as an Elementabstract ElementgetValueAsElement(int index) Returns the value at the specified index in this element as an Elementabstract ConstantReturns the value of this element as a Enumeration constantabstract ConstantgetValueAsEnumeration(int index) Returns the value of the element at the specified index as a Enumeration constantabstract floatReturns the value of this element as a floatabstract floatgetValueAsFloat32(int index) Returns the value of the element at the specified index as a floatabstract doubleReturns the value of this element as a doubleabstract doublegetValueAsFloat64(int index) Returns the value of the element at the specified index as a doubleabstract intReturns the value of this element as a intabstract intgetValueAsInt32(int index) Returns the value of the element at the specified index as a intabstract longReturns the value of this element as a longabstract longgetValueAsInt64(int index) Returns the value of the element at the specified index as a longabstract NameReturns the value of this element as a Enumeration constantabstract NamegetValueAsName(int index) Returns the value of the element at the specified index as a Enumeration constantabstract StringReturns the value of this element as a Stringabstract StringgetValueAsString(int index) Returns the value of the element at the specified index as a Stringabstract DatetimeReturns the value of this element as a Timeabstract DatetimegetValueAsTime(int index) Returns the value of the element at the specified index as a Timeabstract booleanhasElement(Name name) Returns true if this element contains an element with the specified nameabstract booleanhasElement(Name name, boolean excludeNullElements) Returns true if this element contains an element with the specified nameabstract booleanhasElement(String name) Deprecated.UsehasElement(Name)instead.abstract booleanhasElement(String name, boolean excludeNullElements) Deprecated.UsehasElement(Name, boolean)instead.abstract booleanisArray()Returns true if this element is an arrayabstract booleanIndicates whether this element is a complex type.abstract booleanabstract booleanReturn true if the value at the specified index of this element is equal to the specified constantabstract booleanisNull()Returns true if this element is null.abstract booleanisNullValue(int position) Returns true if the element at the specified position in a Sequence or choice element is null.abstract booleanReturns true if this element cannot be modifiedabstract Namename()Return the name of this Elementabstract intReturn the number of elements this element containsabstract intReturn the number of values this element containsabstract voidprint(OutputStream output) Prints the contents of this element to the specified OutputStream.abstract voidPrints the contents of this element to the specified Writer.abstract ElementSet the named sub-element as the choice's selectionabstract ElementDeprecated.UsesetChoice(Name)instead.abstract voidsetElement(Name name, boolean value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, byte[] value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, char value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, double value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, float value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, int value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, long value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, Constant value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, Datetime value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, Name value) Set the named sub-element to the specified valueabstract voidsetElement(Name name, String value) Set the named sub-element to the specified valueabstract voidsetElement(String name, boolean value) Deprecated.UsesetElement(Name, boolean)instead.abstract voidsetElement(String name, byte[] value) Deprecated.UsesetElement(Name, byte[])instead.abstract voidsetElement(String name, char value) Deprecated.UsesetElement(Name, char)instead.abstract voidsetElement(String name, double value) Deprecated.UsesetElement(Name, double)instead.abstract voidsetElement(String name, float value) Deprecated.UsesetElement(Name, float)instead.abstract voidsetElement(String name, int value) Deprecated.UsesetElement(Name, int)instead.abstract voidsetElement(String name, long value) Deprecated.UsesetElement(Name, long)instead.abstract voidsetElement(String name, Constant value) Deprecated.UsesetElement(Name, Constant)instead.abstract voidsetElement(String name, Datetime value) Deprecated.UsesetElement(Name, Datetime)instead.abstract voidsetElement(String name, Name value) Deprecated.UsesetElement(Name, Name)instead.abstract voidsetElement(String name, String value) Deprecated.UsesetElement(Name, String)instead.abstract voidsetValue(boolean value) Set the value of this element to the specified value.abstract voidsetValue(boolean value, int index) Set the value of the element at the specified index to the specified valueabstract voidsetValue(byte[] value) Set the value of this element to the specified value.abstract voidsetValue(byte[] value, int index) Set the value of this element to the specified valueabstract voidsetValue(char value) Set the value of this element to the specified value.abstract voidsetValue(char value, int index) Set the value of this element to the specified valueabstract voidsetValue(double value) Set the value of this element to the specified value.abstract voidsetValue(double value, int index) Set the value of this element to the specified valueabstract voidsetValue(float value) Set the value of this element to the specified value.abstract voidsetValue(float value, int index) Set the value of this element to the specified valueabstract voidsetValue(int value) Set the value of this element to the specified value.abstract voidsetValue(int value, int index) Set the value of this element to the specified valueabstract voidsetValue(long value) Set the value of this element to the specified value.abstract voidsetValue(long value, int index) Set the value of this element to the specified valueabstract voidSet the value of this element to the specified value.abstract voidSet the value of this element to the specified valueabstract voidSet the value of this element to the specified value.abstract voidSet the value of this element to the specified valueabstract voidSet the value of this element to the specified value.abstract voidSet the value of this element to the specified constant valueabstract voidSet the value of this element to the specified value.abstract voidSet the value of this element to the specified valueabstract StringtoString()Returns the contents of this element as a Stringabstract SchemaTypeDefinitionReturns the SchemaTypeDefinition for this element.abstract booleanvalueIsNull(int position) Deprecated.As of 3.2.1, replaced byisNullValue(int)
-
Constructor Details
-
Element
public Element()
-
-
Method Details
-
name
Return the name of this ElementIf 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.
- Returns:
- name
-
datatype
Returns the Datatype of this ElementEquivalent to calling
elementDefinition().typeDefinition().datatype()- Returns:
- data type
-
isArray
public abstract boolean isArray()Returns true if this element is an arrayAn element is considered an array if
elementDefinition().maxValues()is greater than 1 or SchemaElementDefinition.UNBOUNDED- Returns:
- true if this element is an array and false otherwise
-
isComplexType
public abstract boolean isComplexType()Indicates whether this element is a complex type.- Returns:
trueif thedatatype()is eitherSchema.Datatype.SEQUENCEorSchema.Datatype.CHOICEand this element is not an array,falseotherwise
-
isReadOnly
public abstract boolean isReadOnly()Returns true if this element cannot be modifiedPlease note that calling setters on a readonly element will cause an UnsupportedOperationException to be thrown
- Returns:
- true if this object is not modifiable
-
elementDefinition
Return a reference to the read-only element definition object that defines the properties of this elements value. -
typeDefinition
Returns the SchemaTypeDefinition for this element.This is equivalent to calling
elementDefinition().datatype()- Returns:
- the type definition
-
numValues
public abstract int numValues()Return the number of values this element containsThe 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.
- Returns:
- number of values
-
numElements
public abstract int numElements()Return the number of elements this element containsElements for which
isComplexType()is false always return 0 Choice elements always return 1. Sequence elements return the actual number of elements they contain.- Returns:
- number of elements
-
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
Deprecated.As of 3.2.1, replaced byisNullValue(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- ifposition >= 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- ifposition >= numElements()
-
isEqualTo
- Returns:
- true if the value this element is equal to the specified constant
-
isEqualTo
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 comparedindex- the Index of the value in this element that the constant is being compared to.- Returns:
- if the i-th value in this element is equal to the constant
- Throws:
IndexOutOfBoundsException- ifindex >=numValues()
-
findConstant
Find and return a constant in the specified constantsList with the same value as this element.- Parameters:
constantsList- List of constants to compare- Returns:
- Constant with the same value as this element
- Throws:
IndexOutOfBoundsExceptionNotFoundException
-
findConstant
Find and return a constant in the specified constantLists with the value stored in this element at the given index- Parameters:
constantsList- List of constants to compareindex- Position of the value to check- Throws:
NotFoundExceptionIndexOutOfBoundsException
-
getValueAsElement
Returns the value of this element as an ElementSame 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 ElementIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsElement
Returns the value at the specified index in this element as an ElementApplicable 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:
IndexOutOfBoundsException- if the specifiedindex >=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 booleanSame 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 booleanIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsBool
public abstract boolean getValueAsBool(int index) Returns the value of the element at the specified index as a booleanIf 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 booleanIndexOutOfBoundsException- ifindex >=numValues()
-
getValueAsChar
public abstract char getValueAsChar()Returns the value of this element as a charSame 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 charIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsChar
public abstract char getValueAsChar(int index) Returns the value of the element at the specified index as a charIf 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:
IndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsInt32
public abstract int getValueAsInt32()Returns the value of this element as a intSame 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 intIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsInt32
public abstract int getValueAsInt32(int index) Returns the value of the element at the specified index as a intIf 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 intIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsInt64
public abstract long getValueAsInt64()Returns the value of this element as a longSame 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 longIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsInt64
public abstract long getValueAsInt64(int index) Returns the value of the element at the specified index as a longIf 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 longIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsFloat64
public abstract double getValueAsFloat64()Returns the value of this element as a doubleSame 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 doubleIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsFloat64
public abstract double getValueAsFloat64(int index) Returns the value of the element at the specified index as a doubleIf 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 doubleIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsFloat32
Returns the value of this element as a floatSame 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 floatIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsFloat32
public abstract float getValueAsFloat32(int index) Returns the value of the element at the specified index as a floatIf 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 floatIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsString
Returns the value of this element as a StringSame 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 StringIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsString
Returns the value of the element at the specified index as a StringIf 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 StringIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsBytes
public abstract byte[] getValueAsBytes()Returns the value of this element as a byte arraySame 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 arrayIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsBytes
public abstract byte[] getValueAsBytes(int index) Returns the value of the element at the specified index as a byte arrayIf 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 arrayIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsDatetime
Returns the value of this element as a DatetimeSame 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 DatetimeIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsDatetime
Returns the value of the element at the specified index as a DatetimeIf 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 DatetimeIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsDate
Returns the value of this element as a DateSame 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 DateIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsDate
Returns the value of the element at the specified index as a DateIf 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 DateIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsTime
Returns the value of this element as a TimeSame 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 TimeIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsTime
Returns the value of the element at the specified index as a TimeIf 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 TimeIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsEnumeration
Returns the value of this element as a Enumeration constantSame 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 EnumerationIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsEnumeration
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 constantIndexOutOfBoundsException- ifindex >= numValues()
-
getValueAsName
Returns the value of this element as a Enumeration constantSame 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 EnumerationIndexOutOfBoundsException- ifnumValues()== 0- See Also:
-
getValueAsName
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 constantIndexOutOfBoundsException- ifindex >= numValues()
-
hasElement
Returns true if this element contains an element with the specified nameSame 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:
UnsupportedOperationException- if called on non complex type
-
hasElement
Returns true if this element contains an element with the specified nameNull elements are ignored if the excludeNullElements parameter is true. They are included otherwise
- Returns:
- true if an element with the specified name exists
- Throws:
UnsupportedOperationException- if called on non complex type
-
hasElement
Deprecated.UsehasElement(Name)instead.Returns true if this element contains an element with the specified nameSame 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:
UnsupportedOperationException- if called on non complex type
-
hasElement
Deprecated.UsehasElement(Name, boolean)instead.Returns true if this element contains an element with the specified nameNull elements are ignored if the excludeNullElements parameter is true. They are included otherwise
- Returns:
- true if an element with the specified name exists
- Throws:
UnsupportedOperationException- if called on non complex type
-
getElement
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
Return the named sub-element, creating it if it doesn't exist if this element is modifiableThis 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 availableUnsupportedOperationException- if called on non complex type
-
getElement
Deprecated.UsegetElement(Name)instead.Return the named sub-element, creating it if it doesn't exist if this element is modifiableThis 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 availableUnsupportedOperationException- if called on non complex type
-
getElementAsBool
Returns the value of the named sub-element as a booleansame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a booleanUnsupportedOperationException- if called on non complex type
-
getElementAsBool
Deprecated.UsegetElementAsBool(Name)instead.Returns the value of the named sub-element as a booleansame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a booleanUnsupportedOperationException- if called on non complex type
-
getElementAsChar
Returns the value of the named sub-element as a charsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a char
-
getElementAsChar
Deprecated.UsegetElementAsChar(Name)instead.Returns the value of the named sub-element as a charsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a char
-
getElementAsInt32
Returns the value of the named sub-element as a intsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a int
-
getElementAsInt32
Deprecated.UsegetElementAsInt32(Name)instead.Returns the value of the named sub-element as a intsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a int
-
getElementAsInt64
Returns the value of the named sub-element as a longsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a long
-
getElementAsInt64
Deprecated.UsegetElementAsInt64(Name)instead.Returns the value of the named sub-element as a intsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a long
-
getElementAsFloat64
Returns the value of the named sub-element as a doublesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a double
-
getElementAsFloat64
Deprecated.UsegetElementAsFloat64(Name)instead.Returns the value of the named sub-element as a doublesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a double
-
getElementAsFloat32
Returns the value of the named sub-element as a floatsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a float
-
getElementAsFloat32
Deprecated.UsegetElementAsFloat32(Name)instead.Returns the value of the named sub-element as a floatsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a float
-
getElementAsString
Returns the value of the named sub-element as a Stringsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a String
-
getElementAsString
Deprecated.UsegetElementAsString(Name)instead.Returns the value of the named sub-element as a Stringsame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a String
-
getElementAsBytes
Returns the value of the named sub-element as a byte arraysame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a byte array
-
getElementAsBytes
Deprecated.UsegetElementAsBytes(Name)instead.Returns the value of the named sub-element as a byte arraysame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a byte array
-
getElementAsDatetime
Returns the value of the named sub-element as a Datetimesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Datetime
-
getElementAsDatetime
Deprecated.UsegetElementAsDatetime(Name)instead.Returns the value of the named sub-element as a Datetimesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Datetime
-
getElementAsDate
Returns the value of the named sub-element as a Datesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Date
-
getElementAsDate
Deprecated.UsegetElementAsDate(Name)instead.Returns the value of the named sub-element as a Datesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Date
-
getElementAsTime
Returns the value of the named sub-element as a Timesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Time
-
getElementAsTime
Deprecated.UsegetElementAsTime(Name)instead.Returns the value of the named sub-element as a Timesame 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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Time
-
getElementAsName
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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Name
-
getElementAsName
Deprecated.UsegetElementAsName(Name)instead.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 existInvalidConversionException- if the value of the named sub-element cannot be converted to a Name
-
getChoice
-
toString
Returns the contents of this element as a String -
print
Prints the contents of this element to the specified OutputStream.- Throws:
IOException
-
print
Prints the contents of this element to the specified Writer.- Throws:
IOException
-
clone
-
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:
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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- 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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- 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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- 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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- 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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- 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:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- if the specified value cannot be converted to the data type of the array
-
appendValue
Append the specified value to this array element- Parameters:
value- the value to be appended to this array element- Throws:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- if the specified value cannot be converted to the data type of the array
-
appendValue
Append the specified value to this array element- Parameters:
value- the value to be appended to this array element- Throws:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- if the specified value cannot be converted to the data type of the array
-
appendValue
Append the specified Constant value to this array element- Parameters:
value- the value to be appended to this array element- Throws:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- if this element's type is not an enumeration type, or ifvaluedoes not refer to a constant in the enumeration type of this element
-
appendValue
Append the specified value to this array element- Parameters:
value- the value to be appended to this array element- Throws:
UnsupportedOperationException- if called on a non-array or if the element is read-onlyInvalidConversionException- if the specified value cannot be converted to the data type of the array
-
appendValue
Deprecated.Arrays of byte arrays are not supported. This method will always throw anUnsupportedOperationException.Append the specified value to this array element- Parameters:
value- the value to be appended to this array element- Throws:
UnsupportedOperationException- in all cases, since arrays of byte arrays are not supported.
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, boolean)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, char)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, int)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, long)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, double)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, float)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, Datetime)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, Constant)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the named sub-element's type is not an enumeration type, or ifvaluedoes not refer to a constant in the enumeration type of the named sub-elementUnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, Name)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the named sub-element's type is not an enumeration type, or ifvaluedoes not refer to a constant in the enumeration type of the named sub-elementUnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, String)instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setElement
Deprecated.UsesetElement(Name, byte[])instead.Set the named sub-element to the specified value- Parameters:
name- the Name of the sub-element to setvalue- the value to be set for the specified element- Throws:
NotFoundException- if the named sub-element cannot be foundInvalidConversionException- if the element specified by name cannot be initialized with the specified value.UnsupportedOperationException- if this element is not a sequence or choice or if this element is read-only
-
setChoice
Set the named sub-element as the choice's selectionNote that if this choice element already contains a selection it is discarded and 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 foundUnsupportedOperationException- if this element is not a choice or if this element is read-only
-
setChoice
Deprecated.UsesetChoice(Name)instead.Set the named sub-element as the choice's selectionNote that if this choice element already contains a selection it is discarded and 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 foundUnsupportedOperationException- 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 callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(char value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(int value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(long value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(double value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(float value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
Set the value of this element to the specified value. Same as callingsetValue(value, 0)- Throws:
InvalidConversionException- if this element cannot be initialized with the specified value
-
setValue
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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
Set the value of this element to the specified value. Same as callingsetValue(value, 0)- Throws:
InvalidConversionException- if this element cannot be initialized with the specified value
-
setValue
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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
Set the value of this element to the specified value. Same as callingsetValue(value, 0)- Throws:
InvalidConversionException- if this element's type is not an enumeration type, or ifconstantdoes not refer to a constant in the enumeration type of this element
-
setValue
Set the value of this element to the specified constant value- Throws:
InvalidConversionException- if this element's type is not an enumeration type, or ifconstantdoes not refer to a constant in the enumeration type of this elementIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
Set the value of this element to the specified value. Same as callingsetValue(value, 0)- Throws:
InvalidConversionException- if this element cannot be initialized with the specified value
-
setValue
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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
setValue
public abstract void setValue(byte[] value) Set the value of this element to the specified value. Same as callingsetValue(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 valueIndexOutOfBoundsException- ifindex >=numValues()
-
elementIterator
Return an iterator for iterating over elements of this Sequence or Choice
-