Documentation of 'org.jlab.hipo.data.HipoNode' Java class
HipoNode
org.jlab.hipo.data

Class HipoNode



  • public class HipoNode
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      HipoNode(byte[] buffer)
      Initialize HipoNode from a byte array.
      HipoNode(int group, int item, double[] value) 
      HipoNode(int group, int item, float[] value) 
      HipoNode(int group, int item, HipoNodeType type, int length) 
      HipoNode(int group, int item, java.lang.String value) 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void createNode(int group, int item, HipoNodeType type, int length)
      Creates a node for given type
      void createNode(int group, int item, java.lang.String value) 
      byte[] getBufferData()
      returns the byte[] array of the buffer
      int getBufferSize()
      returns the size of the buffer, including the header.
      byte[] getByte() 
      byte getByte(int index)
      returns a byte element from the array.
      int getDataSize()
      returns number of elements in the data array.
      java.lang.String getDataString()
      returns string representation of the data.
      double[] getDouble()
      returns a float array containing the data from the node.
      double getDouble(int index) 
      float[] getFloat()
      returns a float array containing the data from the node.
      float getFloat(int index)
      returns a float number of the element with given index
      int getGroup()
      returns the group id of the node.
      java.lang.String getHeaderString()
      returns a String with header information.
      int[] getInt() 
      int getInt(int index) 
      int getItem()
      returns the item id of the node
      long getLong(int index) 
      short[] getShort() 
      short getShort(int index)
      returns the value of the short array for given index.
      java.lang.String getString()
      returns a String object from the node.
      HipoNodeType getType()
      returns type of the elements stored in the buffer.
      float getVectorX(int index)
      Get X component of the vector from the node with TYPE VECTOR3F
      float getVectorY(int index)
      Get Y component of the vector from the node with TYPE VECTOR3F
      float getVectorZ(int index)
      Get Z component of the vector from the node with TYPE VECTOR3F
      static void main(java.lang.String[] args)
      main program for tests
      void setByte(int index, byte value)
      Set content of the node with type BYTE, for element index
      void setDouble(int index, double value) 
      void setFloat(int index, float value) 
      void setInt(int index, int value)
      set integer value to the element of the node
      void setLong(int index, long value) 
      void setShort(int index, short value) 
      void setVector(int index, float x, float y, float z)
      sets all components for the vector with index
      void setVectorX(int index, float value)
      sets X component of the vector with index
      void setVectorY(int index, float value)
      sets X component of the vector with index
      void setVectorZ(int index, float value)
      sets X component of the vector with index
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HipoNode

        public HipoNode(int group,
                        int item,
                        HipoNodeType type,
                        int length)
      • HipoNode

        public HipoNode(int group,
                        int item,
                        java.lang.String value)
      • HipoNode

        public HipoNode(int group,
                        int item,
                        float[] value)
      • HipoNode

        public HipoNode(int group,
                        int item,
                        double[] value)
      • HipoNode

        public HipoNode(byte[] buffer)
        Initialize HipoNode from a byte array.
        Parameters:
        buffer - byte array with the data
    • Method Detail

      • createNode

        public final void createNode(int group,
                                     int item,
                                     java.lang.String value)
      • createNode

        public final void createNode(int group,
                                     int item,
                                     HipoNodeType type,
                                     int length)
        Creates a node for given type
        Parameters:
        group - group id
        item - item id
        type - type of the node
        length - number of elements in the node
      • getDataSize

        public int getDataSize()
        returns number of elements in the data array. This is not the buffer length.
        Returns:
        n elements of the array if the node is a primitive data.
      • getBufferSize

        public int getBufferSize()
        returns the size of the buffer, including the header.
        Returns:
        internal ByteBuffer size
      • getBufferData

        public byte[] getBufferData()
        returns the byte[] array of the buffer
        Returns:
        array of bytes
      • getGroup

        public int getGroup()
        returns the group id of the node.
        Returns:
        group id
      • getItem

        public int getItem()
        returns the item id of the node
        Returns:
        item id
      • getDataString

        public java.lang.String getDataString()
        returns string representation of the data.
        Returns:
        data string
      • getHeaderString

        public java.lang.String getHeaderString()
        returns a String with header information.
        Returns:
        string representation of the header.
      • getType

        public final HipoNodeType getType()
        returns type of the elements stored in the buffer.
        Returns:
      • getString

        public java.lang.String getString()
        returns a String object from the node. Strings are stored as byte[]. The data is copied into String.
        Returns:
        String representation of byte array.
      • getByte

        public byte getByte(int index)
        returns a byte element from the array.
        Parameters:
        index - index of the element
        Returns:
      • getByte

        public byte[] getByte()
      • getFloat

        public float[] getFloat()
        returns a float array containing the data from the node. needs to be optimized with ArrayCopy !
        Returns:
        float[] array of the node.
      • getDouble

        public double[] getDouble()
        returns a float array containing the data from the node. needs to be optimized with ArrayCopy !
        Returns:
        float[] array of the node.
      • getFloat

        public float getFloat(int index)
        returns a float number of the element with given index
        Parameters:
        index - index of the element.
        Returns:
      • getVectorX

        public float getVectorX(int index)
        Get X component of the vector from the node with TYPE VECTOR3F
        Parameters:
        index - index of the vector
        Returns:
        X component
      • getVectorY

        public float getVectorY(int index)
        Get Y component of the vector from the node with TYPE VECTOR3F
        Parameters:
        index - index of the vector
        Returns:
        Y component
      • getVectorZ

        public float getVectorZ(int index)
        Get Z component of the vector from the node with TYPE VECTOR3F
        Parameters:
        index - index of the vector
        Returns:
        Z component
      • getShort

        public short getShort(int index)
        returns the value of the short array for given index.
        Parameters:
        index - index of the array
        Returns:
        the value
      • getInt

        public int getInt(int index)
      • getInt

        public int[] getInt()
      • getShort

        public short[] getShort()
      • getLong

        public long getLong(int index)
      • getDouble

        public double getDouble(int index)
      • setByte

        public void setByte(int index,
                            byte value)
        Set content of the node with type BYTE, for element index
        Parameters:
        index - element index
        value - byte value to set
      • setShort

        public void setShort(int index,
                             short value)
      • setInt

        public void setInt(int index,
                           int value)
        set integer value to the element of the node
        Parameters:
        index - order of the array
        value - value to set
      • setLong

        public void setLong(int index,
                            long value)
      • setFloat

        public void setFloat(int index,
                             float value)
      • setDouble

        public void setDouble(int index,
                              double value)
      • setVector

        public void setVector(int index,
                              float x,
                              float y,
                              float z)
        sets all components for the vector with index
        Parameters:
        index - order of the vector
        x - x-component of the vector
        y - y-component of the vector
        z - z-component of the vector
      • setVectorX

        public void setVectorX(int index,
                               float value)
        sets X component of the vector with index
        Parameters:
        index - index of the vector
        value - X component value to set
      • setVectorY

        public void setVectorY(int index,
                               float value)
        sets X component of the vector with index
        Parameters:
        index - index of the vector
        value - X component value to set
      • setVectorZ

        public void setVectorZ(int index,
                               float value)
        sets X component of the vector with index
        Parameters:
        index - index of the vector
        value - X component value to set
      • main

        public static void main(java.lang.String[] args)
        main program for tests
        Parameters:
        args -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.