Class NativeSequenceField


  • public class NativeSequenceField
    extends NativeField
    NativeSequenceField is the native representation of an n-dimensional sequence field
    • 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 rank
      NativeSequenceField​(java.lang.String name, short elemType, short packHints)
      Constructs a one dimensional sequence field of the specified element type
      NativeSequenceField​(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 exists
      boolean 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 index
      short 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 indices
      int 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 srcStart
      void setElementValue​(int[] indices, java.lang.Object elemValue)
      Sets the value of the element at the specified indices
      void 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 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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 type
        rank - - number of dimensions
        Throws:
        BrokerException
    • Method Detail

      • setValue

        public void setValue​(java.lang.Object value,
                             short type)
                      throws BrokerException
        Sets the value of the field
        Overrides:
        setValue in class NativeField
        Parameters:
        type - the value type
        value - the new field value
        Throws:
        BrokerException
      • 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 class NativeField
        Parameters:
        indices - the indices of the sequence element whose values will be returned
        start - the index of the first element
        count - the number of elements to return
        Returns:
        a one dimensional array of elements
        Throws:
        BrokerFieldTypeMismatchException - if field is not a sequence
        BrokerException
      • 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 class NativeField
        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 sequence
        BrokerException
      • 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 class NativeField
        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 sequence
        BrokerException
      • 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 class NativeField
        Parameters:
        indices - the indices of the sequence element whose values will be returned
        srcOffset - starting index of source array
        destOffset - starting index of destination sequence
        count - the number of elements to return
        srcArray - the source array of elements
        Throws:
        BrokerFieldTypeMismatchException - if field is not a sequence
        BrokerException
      • 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 class NativeField
        Parameters:
        indices - the indices of the sequence whose length will be set
        Throws:
        BrokerFieldTypeMismatchException - if field is not a sequence
        BrokerException
      • getRank

        public int getRank()
      • 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 class NativeField
        Parameters:
        another - - object to test against
        Returns:
        boolean