Package dap4.dap4lib

Class DSPPrinter


  • public class DSPPrinter
    extends Object
    DAP DSP Printer. Given a constraint and a DSP print the constrained subset of the data in text form.
    • Constructor Detail

      • DSPPrinter

        protected DSPPrinter()
      • DSPPrinter

        public DSPPrinter​(dap4.core.data.DSP dsp,
                          Writer writer)
      • DSPPrinter

        public DSPPrinter​(dap4.core.data.DSP dsp,
                          dap4.core.ce.CEConstraint ce,
                          Writer writer)
    • Method Detail

      • print

        public DSPPrinter print()
                         throws dap4.core.util.DapException
        Print data from a DSP - optionally constrained
        Throws:
        dap4.core.util.DapException
      • printVariable

        protected void printVariable​(dap4.core.data.DataCursor data,
                                     List<dap4.core.util.Slice> slices)
                              throws dap4.core.util.DapException
        Print an arbitrary DataVariable using a constraint.

        Handling newlines is a bit tricky so the rule is that the last newline is elided and left for the caller to print. Exceptions: ?

        Parameters:
        data - - the cursor to print
        Throws:
        dap4.core.util.DapException - Note that the PrintWriter and CEConstraint are global.
      • printScalar

        protected void printScalar​(dap4.core.data.DataCursor data)
                            throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • printArray

        protected void printArray​(dap4.core.data.DataCursor data,
                                  List<dap4.core.util.Slice> slices)
                           throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • printAtomicVector

        protected void printAtomicVector​(dap4.core.data.DataCursor data,
                                         List<dap4.core.util.Slice> slices,
                                         dap4.core.util.Odometer odom)
                                  throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • printAtomicInstance

        protected void printAtomicInstance​(dap4.core.data.DataCursor datav,
                                           dap4.core.util.Index pos)
                                    throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • printCompoundInstance

        protected void printCompoundInstance​(dap4.core.data.DataCursor datav)
                                      throws dap4.core.util.DapException
        Print a single structure or sequence or record instance
        Parameters:
        datav -
        Throws:
        dap4.core.util.DapException
      • indicesToString

        protected String indicesToString​(dap4.core.util.Index indices)
                                  throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • valueString

        protected String valueString​(Object vector,
                                     long pos,
                                     dap4.core.dmr.DapType basetype)
                              throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • hexchar

        protected static char hexchar​(int i)
      • getPrintValue

        protected static String getPrintValue​(Object value)