Package dap4.cdm

Class CDMTypeFcns


  • public abstract class CDMTypeFcns
    extends Object
    This Class is used to isolate as many as possible of the switch statements using TypeSort enums (Or in somecase DapType.getTypeSort()) Singleton
    • Constructor Detail

      • CDMTypeFcns

        public CDMTypeFcns()
    • Method Detail

      • cdmElementClass

        public static Class cdmElementClass​(ucar.ma2.DataType dt)
      • createVector

        public static Object createVector​(ucar.ma2.DataType type,
                                          long count)
      • createVector

        public static Object createVector​(dap4.core.dmr.DapType type,
                                          long count)
      • enumTypeFor

        public static ucar.ma2.DataType enumTypeFor​(dap4.core.dmr.DapType type)
      • cdmtype2daptype

        public static dap4.core.dmr.DapType cdmtype2daptype​(ucar.ma2.DataType datatype)
      • daptype2cdmtype

        public static ucar.ma2.DataType daptype2cdmtype​(dap4.core.dmr.DapType type)
      • daptypeSize

        public static int daptypeSize​(dap4.core.dmr.TypeSort atomtype)
        Conmpute the size, in databuffer, of the daptype wrt to a serialization; 0 if undefined.
        Parameters:
        atomtype - The type of interest
        Returns:
        the size, in databuffer
      • extract

        public static long extract​(dap4.core.dmr.TypeSort sort,
                                   Object value)
      • convert

        public static Object convert​(dap4.core.dmr.TypeSort dstsort,
                                     dap4.core.dmr.TypeSort srcsort,
                                     Object src)
      • vectorcopy

        public static void vectorcopy​(dap4.core.dmr.DapType datatype,
                                      Object src,
                                      Object dst,
                                      long srcoffset,
                                      long dstoffset)
                               throws dap4.core.util.DapException
        Throws:
        dap4.core.util.DapException
      • attributeParse

        public static Object attributeParse​(ucar.ma2.DataType cdmtype,
                                            ucar.nc2.EnumTypedef en,
                                            Object o)
        convert a string to a specified cdmtype Note that if en is defined, then we attempt to convert the string as enum const
        Parameters:
        cdmtype -
        en -
        o -
        Returns:
        parsed attribute
      • isPrimitiveVector

        public static boolean isPrimitiveVector​(ucar.ma2.DataType type,
                                                Object o)
      • arrayify

        public static ucar.ma2.Array arrayify​(ucar.ma2.DataType datatype,
                                              Object o)
      • arrayify

        public static ucar.ma2.Array arrayify​(dap4.core.dmr.DapType type,
                                              Object o)
      • listify

        public static List listify​(Object vector)