Package dap4.dap4lib

Class AbstractDSP

  • All Implemented Interfaces:
    dap4.core.data.DSP
    Direct Known Subclasses:
    D4DSP, Nc4DSP

    public abstract class AbstractDSP
    extends Object
    implements dap4.core.data.DSP
    Provide a superclass for DSPs.
    • Constructor Detail

      • AbstractDSP

        public AbstractDSP()
    • Method Detail

      • open

        public abstract AbstractDSP open​(String location)
                                  throws dap4.core.util.DapException
        "open" a reference to a data source and return the DSP wrapper.
        Specified by:
        open in interface dap4.core.data.DSP
        Parameters:
        location - - Object that defines the data source
        Returns:
        = wrapping dsp
        Throws:
        dap4.core.util.DapException
      • close

        public abstract void close()
                            throws IOException
        Specified by:
        close in interface dap4.core.data.DSP
        Throws:
        IOException
      • getVariableData

        public dap4.core.data.DataCursor getVariableData​(dap4.core.dmr.DapVariable var)
                                                  throws dap4.core.util.DapException
        Specified by:
        getVariableData in interface dap4.core.data.DSP
        Throws:
        dap4.core.util.DapException
      • getContext

        public dap4.core.util.DapContext getContext()
        Specified by:
        getContext in interface dap4.core.data.DSP
      • getLocation

        public String getLocation()
        Specified by:
        getLocation in interface dap4.core.data.DSP
      • setLocation

        public AbstractDSP setLocation​(String loc)
        Specified by:
        setLocation in interface dap4.core.data.DSP
      • getDMR

        public dap4.core.dmr.DapDataset getDMR()
        Specified by:
        getDMR in interface dap4.core.data.DSP
      • setContext

        public void setContext​(dap4.core.util.DapContext context)
        Specified by:
        setContext in interface dap4.core.data.DSP
      • setDMR

        public void setDMR​(dap4.core.dmr.DapDataset dmr)
      • setDataset

        protected void setDataset​(dap4.core.dmr.DapDataset dataset)
                           throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • getOrder

        public ByteOrder getOrder()
        Specified by:
        getOrder in interface dap4.core.data.DSP
      • getChecksumMode

        public dap4.core.data.ChecksumMode getChecksumMode()
        Specified by:
        getChecksumMode in interface dap4.core.data.DSP
      • setChecksumMode

        public AbstractDSP setChecksumMode​(dap4.core.data.ChecksumMode mode)
      • addVariableData

        public void addVariableData​(dap4.core.dmr.DapVariable var,
                                    dap4.core.data.DataCursor cursor)
      • parseDMR

        protected dap4.core.dmr.DapDataset parseDMR​(String document)
                                             throws dap4.core.util.DapException
        It is common to want to parse a DMR text to a DapDataset, so provide this utility.
        Parameters:
        document - the dmr to parse
        Returns:
        the parsed dmr
        Throws:
        dap4.core.util.DapException - on parse errors
      • processAttributes

        protected void processAttributes​(dap4.core.dmr.DapDataset dataset)
                                  throws dap4.core.util.DapException
        Walk the dataset tree and remove selected attributes such as _Unsigned
        Parameters:
        dataset -
        Throws:
        dap4.core.util.DapException
      • suppress

        protected boolean suppress​(String attrname)
        Some attributes that are added by the NetcdfDataset need to be kept out of the DMR. This function defines that set.
        Parameters:
        attrname - A non-escaped attribute name to be tested for suppression
        Returns:
        true if the attribute should be suppressed, false otherwise.
      • printDMR

        public static String printDMR​(dap4.core.dmr.DapDataset dmr)