Package COM.activesw.api.client
Class NativeSequenceField
- java.lang.Object
-
- COM.activesw.api.client.BrokerField
-
- COM.activesw.api.client.NativeField
-
- COM.activesw.api.client.NativeSequenceField
-
public class NativeSequenceField extends NativeField
NativeSequenceField is the native representation of an n-dimensional sequence field
-
-
Field Summary
-
Fields inherited from class COM.activesw.api.client.NativeField
name, PACK_HINT_NAME_IS_STRING8
-
Fields inherited from class COM.activesw.api.client.BrokerField
NOT_FOUND, type, value
-
-
Constructor Summary
Constructors Constructor Description NativeSequenceField(java.lang.String name, short elemType, int rank, short packHints)
Constructs an empty sequence field of the specified element type and rankNativeSequenceField(java.lang.String name, short elemType, short packHints)
Constructs a one dimensional sequence field of the specified element typeNativeSequenceField(java.lang.String name, NativeSequence sequence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
duplicate()
boolean
elementExists(int[] indices)
Returns true if the element at the specified indices existsboolean
equals(java.lang.Object another)
Tests equality.java.lang.Object
getElements(int[] indices, int start, int count)
Returns a one dimensional array of sequence elements starting at the specified indexshort
getElementType(int[] indices)
Returns the element type of the sequence at the specified indices.NativeField
getElementValue(int[] indices)
Returns the value of the element at the specified indicesint
getLength(int[] indices)
Returns the length of the sequence at the specified indices.int
getRank()
java.lang.Object
getValue(short type)
Returns the value of the field.int
hashCode()
void
setElements(int[] indices, int srcOffset, int destOffset, int count, java.lang.Object srcArray)
Sets count elements of a sequence starting at destStart using element values obtained from the src array starting at srcStartvoid
setElementValue(int[] indices, java.lang.Object elemValue)
Sets the value of the element at the specified indicesvoid
setLength(int[] indices, int length)
Sets the length of the sequence at the specified indices.void
setValue(java.lang.Object value, short type)
Sets the value of the field-
Methods inherited from class COM.activesw.api.client.NativeField
clearField, getField, getFieldCount, getFieldNames, getName, getType, isFieldSet, isPrimitive, isSequence, isStruct, isStructOrEvent, setField
-
-
-
-
Constructor Detail
-
NativeSequenceField
public NativeSequenceField(java.lang.String name, short elemType, short packHints) throws BrokerException
Constructs a one dimensional sequence field of the specified element type- Parameters:
elemType
- - sequence element type- Throws:
BrokerException
-
NativeSequenceField
public NativeSequenceField(java.lang.String name, short elemType, int rank, short packHints) throws BrokerException
Constructs an empty sequence field of the specified element type and rank- Parameters:
elemType
- - sequence element typerank
- - number of dimensions- Throws:
BrokerException
-
NativeSequenceField
public NativeSequenceField(java.lang.String name, NativeSequence sequence) throws BrokerException
- Throws:
BrokerException
-
-
Method Detail
-
getValue
public java.lang.Object getValue(short type) throws BrokerException
Returns the value of the field.- Overrides:
getValue
in classNativeField
- Parameters:
type
- requested field type- Returns:
- the field's value
- Throws:
BrokerFieldTypeMismatchException
- if value type does not match typeBrokerFieldTypeMismatchException
- if value type does not match typeBrokerException
-
setValue
public void setValue(java.lang.Object value, short type) throws BrokerException
Sets the value of the field- Overrides:
setValue
in classNativeField
- Parameters:
type
- the value typevalue
- the new field value- Throws:
BrokerException
-
elementExists
public boolean elementExists(int[] indices) throws BrokerException
Returns true if the element at the specified indices exists- Overrides:
elementExists
in classNativeField
- Parameters:
indices
- the indices of the element to test- Returns:
- true if element exists
- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
getElements
public java.lang.Object getElements(int[] indices, int start, int count) throws BrokerException
Returns a one dimensional array of sequence elements starting at the specified index- Overrides:
getElements
in classNativeField
- Parameters:
indices
- the indices of the sequence element whose values will be returnedstart
- the index of the first elementcount
- the number of elements to return- Returns:
- a one dimensional array of elements
- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
getElementValue
public NativeField getElementValue(int[] indices) throws BrokerException
Returns the value of the element at the specified indices- Overrides:
getElementValue
in classNativeField
- Parameters:
indices
- the indices of the element whose value will be returned- Returns:
- the element value
- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
getElementType
public short getElementType(int[] indices) throws BrokerException
Returns the element type of the sequence at the specified indices. One dimensional sequences should pass null for indices.- Overrides:
getElementType
in classNativeField
- Parameters:
indices
- the indices of the sequence whose length will be returned- Returns:
- the length of the sequence
- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
getLength
public int getLength(int[] indices) throws BrokerException
Returns the length of the sequence at the specified indices. One dimensional sequences should pass null for indices.- Overrides:
getLength
in classNativeField
- Parameters:
indices
- the indices of the sequence whose length will be returned- Returns:
- the length of the sequence
- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
setElements
public void setElements(int[] indices, int srcOffset, int destOffset, int count, java.lang.Object srcArray) throws BrokerException
Sets count elements of a sequence starting at destStart using element values obtained from the src array starting at srcStart- Overrides:
setElements
in classNativeField
- Parameters:
indices
- the indices of the sequence element whose values will be returnedsrcOffset
- starting index of source arraydestOffset
- starting index of destination sequencecount
- the number of elements to returnsrcArray
- the source array of elements- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
setElementValue
public void setElementValue(int[] indices, java.lang.Object elemValue) throws BrokerException
Sets the value of the element at the specified indices- Overrides:
setElementValue
in classNativeField
- Parameters:
indices
- the indices of the element to setelemValue
- the value of the element- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
setLength
public void setLength(int[] indices, int length) throws BrokerException
Sets the length of the sequence at the specified indices. To set the length of a one dimensional sequence pass null for indices.- Overrides:
setLength
in classNativeField
- Parameters:
indices
- the indices of the sequence whose length will be set- Throws:
BrokerFieldTypeMismatchException
- if field is not a sequenceBrokerException
-
getRank
public int getRank()
-
duplicate
protected java.lang.Object duplicate() throws BrokerException
- Overrides:
duplicate
in classNativeField
- Throws:
BrokerException
-
equals
public boolean equals(java.lang.Object another)
Description copied from class:NativeField
Tests equality. Two NativeFields are equal if they share the same name. It is only intended to be used during field lookup in a field container.- Overrides:
equals
in classNativeField
- Parameters:
another
- - object to test against- Returns:
- boolean
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classNativeField
-
-