Package dap4.dap4lib.cdm
Class CDMTypeFcns
- java.lang.Object
-
- dap4.dap4lib.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(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 ObjectbytesAsTypeVec(DapType daptype, byte[] bytes)static ClasscdmElementClass(ucar.ma2.DataType dt)static DapTypecdmtype2daptype(ucar.ma2.DataType datatype)static Objectconvert(TypeSort dstsort, TypeSort srcsort, Object src)static ObjectcreateVector(DapType type, long count)static ObjectcreateVector(ucar.ma2.DataType type, long count)static ucar.ma2.DataTypedaptype2cdmtype(DapType type)static intdaptypeSize(TypeSort atomtype)Conmpute the size, in databuffer, of the daptype wrt to a serialization; 0 if undefined.static voiddecodebytes(ByteOrder remoteorder, DapType daptype, byte[] bytes, Object vector)static ucar.ma2.DataTypeenumTypeFor(DapType type)static longextract(TypeSort sort, Object value)static booleanisPrimitiveVector(ucar.ma2.DataType type, Object o)static Listlistify(Object vector)static booleansignify(DapType type)static voidvectorcopy(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)
-
signify
public static boolean signify(DapType type)
-
enumTypeFor
public static ucar.ma2.DataType enumTypeFor(DapType type)
-
cdmtype2daptype
public static DapType cdmtype2daptype(ucar.ma2.DataType datatype)
-
daptype2cdmtype
public static ucar.ma2.DataType daptype2cdmtype(DapType type)
-
daptypeSize
public static int daptypeSize(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
-
vectorcopy
public static void vectorcopy(DapType datatype, Object src, Object dst, long srcoffset, long dstoffset) throws DapException
- Throws:
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)
-
-