Class D4DataCompiler


  • public class D4DataCompiler
    extends Object
    • Field Detail

      • DEBUG

        public static boolean DEBUG
      • dataset

        protected dap4.core.dmr.DapDataset dataset
      • checksummode

        protected dap4.core.data.ChecksumMode checksummode
      • dsp

        protected D4DSP dsp
    • Constructor Detail

      • D4DataCompiler

        public D4DataCompiler​(D4DSP dsp,
                              dap4.core.data.ChecksumMode checksummode,
                              ByteOrder order,
                              ByteBuffer databuffer)
                       throws dap4.core.util.DapException
        Constructor
        Parameters:
        dsp - the D4DSP
        checksummode -
        databuffer - the source of serialized databuffer
        Throws:
        dap4.core.util.DapException
    • Method Detail

      • compile

        public void compile()
                     throws dap4.core.util.DapException
        The goal here is to process the serialized databuffer and locate top-level variable positions in the serialized databuffer. Access to non-top-level variables is accomplished on the fly.
        Throws:
        dap4.core.util.DapException
      • compileVar

        protected D4Cursor compileVar​(dap4.core.dmr.DapVariable dapvar,
                                      D4Cursor container)
                               throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • compileAtomicVar

        protected D4Cursor compileAtomicVar​(dap4.core.dmr.DapVariable var,
                                            D4Cursor container)
                                     throws dap4.core.util.DapException
        Parameters:
        var -
        container -
        Returns:
        data
        Throws:
        dap4.core.util.DapException
      • compileStructureArray

        protected D4Cursor compileStructureArray​(dap4.core.dmr.DapVariable var,
                                                 D4Cursor container)
                                          throws dap4.core.util.DapException
        Compile a structure array.
        Parameters:
        var - the template
        container - if inside a compound object
        Returns:
        A DataCompoundArray for the databuffer for this struct.
        Throws:
        dap4.core.util.DapException
      • compileStructure

        protected D4Cursor compileStructure​(dap4.core.dmr.DapVariable var,
                                            dap4.core.dmr.DapStructure dapstruct,
                                            D4Cursor container)
                                     throws dap4.core.util.DapException
        Compile a structure instance.
        Parameters:
        dapstruct - The template
        container -
        Returns:
        A DataStructure for the databuffer for this struct.
        Throws:
        dap4.core.util.DapException
      • compileSequenceArray

        protected D4Cursor compileSequenceArray​(dap4.core.dmr.DapVariable var,
                                                D4Cursor container)
                                         throws dap4.core.util.DapException
        Compile a sequence array.
        Parameters:
        var - the template
        Returns:
        A DataCompoundArray for the databuffer for this sequence.
        Throws:
        dap4.core.util.DapException
      • compileSequence

        public D4Cursor compileSequence​(dap4.core.dmr.DapVariable var,
                                        dap4.core.dmr.DapSequence dapseq,
                                        D4Cursor container)
                                 throws dap4.core.util.DapException
        Compile a sequence as a set of records.
        Parameters:
        dapseq -
        container -
        Returns:
        sequence
        Throws:
        dap4.core.util.DapException
      • extractChecksum

        protected int extractChecksum​(ByteBuffer data)
                               throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • skip

        protected static void skip​(ByteBuffer data,
                                   int count)
      • getCount

        protected static int getCount​(ByteBuffer data)
      • getPos

        protected static int getPos​(ByteBuffer data)
      • computeTypeSize

        protected static int computeTypeSize​(dap4.core.dmr.DapType daptype)
        Compute the size in databuffer of the serialized form
        Parameters:
        daptype -
        Returns:
        type's serialized form size
      • walkByteStrings

        protected static long walkByteStrings​(long[] positions,
                                              ByteBuffer databuffer)