Package dap4.servlet

Class Generator


  • public class Generator
    extends DapSerializer
    Given a DMR, return: 1. A byte array (byte[]) containing serialized data and (optionally) the DMR

    Requirements: 1. repeatability: given the same DMR, return the same byte array

    Notes: 1. Two options are provided for generating values: a. use of a random number generator with a fixed seed. b. use of a pre-defined sequence of values with repetition when the sequence is exhausted (not yet implemented).

    Additionally, provide two options for generating data from a DMR. 1. Automated generation of the data from the whole DMR. 2. Selective generation by starting at some variable in the DMR. This is useful when one wants more detailed control over e.g. the number of tuples in a sequence.

    • Field Detail

      • asciionly

        protected static boolean asciionly
      • values

        protected Value values
      • withdmr

        protected boolean withdmr
      • dmr

        protected dap4.core.dmr.DapDataset dmr
    • Constructor Detail

      • Generator

        public Generator​(dap4.core.dmr.DapDataset dmr,
                         Value.ValueSource src)
                  throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
    • Method Detail

      • setASCII

        public static void setASCII​(boolean tf)
      • getRowCount

        public static int getRowCount()
      • setRowCount

        public static void setRowCount​(int count)
      • generate

        public void generate​(dap4.core.ce.CEConstraint ce,
                             ChunkWriter cw,
                             boolean withdmr,
                             dap4.core.data.ChecksumMode mode)
                      throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • begin

        public void begin​(dap4.core.ce.CEConstraint ce,
                          ChunkWriter cw,
                          boolean withdmr,
                          dap4.core.data.ChecksumMode mode)
                   throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • end

        public void end()
                 throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • generateDMR

        public void generateDMR​(dap4.core.dmr.DapDataset dmr)
                         throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • dataset

        public void dataset​(dap4.core.dmr.DapDataset dmr)
                     throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • variable

        public void variable​(dap4.core.dmr.DapVariable dapvar)
                      throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • atomicVariable

        public void atomicVariable​(dap4.core.dmr.DapVariable dapvar)
                            throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • structureVariable

        public void structureVariable​(dap4.core.dmr.DapVariable var)
                               throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • sequenceVariable

        public void sequenceVariable​(dap4.core.dmr.DapVariable var)
                              throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException