Package dap4.cdm
Class CDMTypeFcns
- java.lang.Object
-
- dap4.cdm.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 Summary
Constructors Constructor Description CDMTypeFcns()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ucar.ma2.Arrayarrayify(dap4.core.dmr.DapType type, Object o)static ucar.ma2.Arrayarrayify(ucar.ma2.DataType datatype, Object o)static ObjectattributeParse(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 conststatic ClasscdmElementClass(ucar.ma2.DataType dt)static dap4.core.dmr.DapTypecdmtype2daptype(ucar.ma2.DataType datatype)static Objectconvert(dap4.core.dmr.TypeSort dstsort, dap4.core.dmr.TypeSort srcsort, Object src)static ObjectcreateVector(dap4.core.dmr.DapType type, long count)static ObjectcreateVector(ucar.ma2.DataType type, long count)static ucar.ma2.DataTypedaptype2cdmtype(dap4.core.dmr.DapType type)static intdaptypeSize(dap4.core.dmr.TypeSort atomtype)Conmpute the size, in databuffer, of the daptype wrt to a serialization; 0 if undefined.static ucar.ma2.DataTypeenumTypeFor(dap4.core.dmr.DapType type)static longextract(dap4.core.dmr.TypeSort sort, Object value)static booleanisPrimitiveVector(ucar.ma2.DataType type, Object o)static Listlistify(Object vector)static voidvectorcopy(dap4.core.dmr.DapType datatype, Object src, Object dst, long srcoffset, long dstoffset)
-
-
-
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)
-
-