public abstract class CDMUtil extends Object
| Constructor and Description |
|---|
CDMUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class |
cdmElementClass(DataType dt) |
static DapType |
cdmtype2daptype(DataType datatype,
boolean unsigned) |
static int[] |
computeEffectiveShape(List<DapDimension> dimset)
Compute the shape inferred from a set of slices.
|
static Object |
convertVector(DapType dsttype,
DapType srctype,
Object src)
Convert an array of one type of values to another type
|
static List<Range> |
createCDMRanges(List<Slice> slices) |
static Object |
createVector(AtomicType atype,
long count)
Given an arbitrary Array (including ArrayStructure), produce
a new Array that represents the slice defined by the
section.
|
static DataType |
daptype2cdmtype(DapType daptype) |
static int |
daptypeSize(AtomicType atomtype)
Conmpute the size, in databuffer,
of the daptype wrt to a serialization;
0 if undefined.
|
static DataType |
enumtypefor(DapType dt) |
static double |
extractDoubleValue(AtomicType atomtype,
D4DataAtomic dataset,
int index)
Extract, as a double, value from a (presumably)
atomic typed array of values; dataset position
is presumed correct.
|
static long |
extractLongValue(AtomicType atomtype,
D4DataAtomic dataset,
long index)
Extract, as a long, value from a (presumably)
atomic typed array of values; dataset position
is presumed correct.
|
static Object |
extractVector(D4DataAtomic dataset,
long index,
long count)
Extract, as an object, n consecutive values
of an atomic typed array of values
|
static String |
getChecksumString(byte[] checksum) |
static boolean |
hasVLEN(List<Range> ranges) |
static boolean |
hasVLEN(Variable v)
Test if any dimension is variable length
|
static boolean |
isWhole(List<Range> rangelist,
List<DapDimension> dimset,
int start,
int stop)
Test a List
|
static boolean |
isWhole(List<Range> rangelist,
List<Slice> slices)
Test a List
|
static boolean |
isWhole(List<Range> rangelist,
Variable var)
Test a List
|
static List<Slice> |
rangeConvert(List<Range> rangelist)
Convert a list of ucar.ma2.Range to a list of Slice
|
static Variable |
unwrap(Variable var)
NetcdfDataset can end up wrapping a variable
in multiple wrapping classes (e.g.
|
static NetcdfFile |
unwrapfile(NetcdfFile file)
NetcdfDataset can wrap a NetcdfFile.
|
public static List<Slice> rangeConvert(List<Range> rangelist) throws DapException
rangelist - the set of ucar.ma2.RangeDapExceptionpublic static boolean isWhole(List<Range> rangelist, List<DapDimension> dimset, int start, int stop) throws DapException
rangelist - the set of ucar.ma2.Rangedimset - the set of DapDimensionsstart - start looking herestop - stop looking hereDapExceptionpublic static boolean isWhole(List<Range> rangelist, List<Slice> slices) throws DapException
rangelist - the set of ucar.ma2.Rangeslices - the set of slicesDapExceptionpublic static boolean isWhole(List<Range> rangelist, Variable var) throws DapException
rangelist - the set of ucar.ma2.Rangevar - the cdm varDapExceptionpublic static List<Range> createCDMRanges(List<Slice> slices) throws IOException
IOExceptionpublic static Variable unwrap(Variable var)
var - possibly wrapped variablepublic static NetcdfFile unwrapfile(NetcdfFile file)
file - NetcdfFile or NetcdfDatasetpublic static boolean hasVLEN(Variable v)
public static int daptypeSize(AtomicType atomtype)
atomtype - The type of interestpublic static int[] computeEffectiveShape(List<DapDimension> dimset)
dimset - from which to generate shapepublic static long extractLongValue(AtomicType atomtype, D4DataAtomic dataset, long index) throws DataException
atomtype - type of object to extractdataset - D4Data containing the objectsindex - Which element of dataset to readForbiddenConversionException - if cannot convert to longDataExceptionpublic static double extractDoubleValue(AtomicType atomtype, D4DataAtomic dataset, int index) throws DataException
atomtype - type of object to extractdataset - D4Data containing the objectsindex - Which element of dataset to readForbiddenConversionException - if cannot convert to doubleDataExceptionpublic static Object extractVector(D4DataAtomic dataset, long index, long count) throws DataException
dataset - D4Data containing the objectsindex - Starting element to readcount - Number of elements to readDataExceptionpublic static Object convertVector(DapType dsttype, DapType srctype, Object src)
dsttype - target typesrctype - source typesrc - array of values to convertpublic static Object createVector(AtomicType atype, long count)
public static String getChecksumString(byte[] checksum)
Copyright © 1999–2014 UCAR/Unidata. All rights reserved.