Package dap4.dap4lib.netcdf
Class Nc4Cursor
- java.lang.Object
-
- dap4.dap4lib.AbstractCursor
-
- dap4.dap4lib.netcdf.Nc4Cursor
-
- All Implemented Interfaces:
dap4.core.data.DataCursor
public class Nc4Cursor extends AbstractCursor
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEBUGprotected Nc4DSP.Nc4Pointermemory-
Fields inherited from class dap4.dap4lib.AbstractCursor
arrayindex, container, dsp, recordcount, recordindex, scheme, template
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddebug()static voiderrcheck(ucar.nc2.jni.netcdf.Nc4prototypes nc4, int ret)protected Objectgetatomicdata(dap4.core.dmr.DapType basetype, long lcount, long elemsize, Nc4DSP.Nc4Pointer mem)longgetElementSize()protected longgetElementSize(Nc4Notes.TypeNotes ti)dap4.core.util.IndexgetIndex()Nc4DSP.Nc4PointergetMemory()longgetOffset()longgetRecordCount()Nc4Notes.TypeNotesgetVlenType(dap4.core.dmr.DapVariable v)If the basetype is sequence (=> isVlen()), then return the type of the first field of this sequence.Objectread(dap4.core.util.Index index)Objectread(List<dap4.core.util.Slice> slices)protected ObjectreadAtomic(List<dap4.core.util.Slice> slices)protected ObjectreadAtomicScalar(Nc4Notes.VarNotes vi, Nc4Notes.TypeNotes ti)Read a top-level scalar atomic variableprotected ObjectreadAtomicVector(Nc4Notes.VarNotes vi, Nc4Notes.TypeNotes ti, long count, List<dap4.core.util.Slice> slices)static voidreadcheck(ucar.nc2.jni.netcdf.Nc4prototypes nc4, int ret)Nc4CursorreadField(int findex)Nc4CursorreadRecord(long recno)protected Nc4CursorreadSequence(dap4.core.util.Index index)protected Nc4CursorreadStructure(dap4.core.util.Index index)Nc4CursorsetMemory(Nc4DSP.Nc4Pointer p)-
Methods inherited from class dap4.dap4lib.AbstractCursor
fieldIndex, getContainer, getDSP, getRecordIndex, getScheme, getTemplate, isAtomic, isCompound, isCompoundArray, isField, isScalar, schemeFor, setContainer, setDSP, setIndex, setRecordCount, setRecordIndex, setScheme, setTemplate, toString
-
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
-
memory
protected Nc4DSP.Nc4Pointer memory
-
-
Method Detail
-
read
public Object read(dap4.core.util.Index index) throws dap4.core.util.DapException
- Specified by:
readin interfacedap4.core.data.DataCursor- Specified by:
readin classAbstractCursor- Throws:
dap4.core.util.DapException
-
read
public Object read(List<dap4.core.util.Slice> slices) throws dap4.core.util.DapException
- Specified by:
readin interfacedap4.core.data.DataCursor- Specified by:
readin classAbstractCursor- Throws:
dap4.core.util.DapException
-
readField
public Nc4Cursor readField(int findex) throws dap4.core.util.DapException
- Specified by:
readFieldin interfacedap4.core.data.DataCursor- Specified by:
readFieldin classAbstractCursor- Throws:
dap4.core.util.DapException
-
getRecordCount
public long getRecordCount()
- Specified by:
getRecordCountin interfacedap4.core.data.DataCursor- Overrides:
getRecordCountin classAbstractCursor
-
readRecord
public Nc4Cursor readRecord(long recno) throws dap4.core.util.DapException
- Specified by:
readRecordin interfacedap4.core.data.DataCursor- Specified by:
readRecordin classAbstractCursor- Throws:
dap4.core.util.DapException
-
getIndex
public dap4.core.util.Index getIndex() throws dap4.core.util.DapException- Specified by:
getIndexin interfacedap4.core.data.DataCursor- Overrides:
getIndexin classAbstractCursor- Throws:
dap4.core.util.DapException
-
readAtomic
protected Object readAtomic(List<dap4.core.util.Slice> slices) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
readAtomicScalar
protected Object readAtomicScalar(Nc4Notes.VarNotes vi, Nc4Notes.TypeNotes ti) throws dap4.core.util.DapException
Read a top-level scalar atomic variable- Parameters:
vi-ti-- Returns:
- Object scalar
- Throws:
dap4.core.util.DapException
-
readAtomicVector
protected Object readAtomicVector(Nc4Notes.VarNotes vi, Nc4Notes.TypeNotes ti, long count, List<dap4.core.util.Slice> slices) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
readStructure
protected Nc4Cursor readStructure(dap4.core.util.Index index) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
readSequence
protected Nc4Cursor readSequence(dap4.core.util.Index index) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
getOffset
public long getOffset()
-
getElementSize
public long getElementSize()
-
getMemory
public Nc4DSP.Nc4Pointer getMemory()
-
setMemory
public Nc4Cursor setMemory(Nc4DSP.Nc4Pointer p)
-
getElementSize
protected long getElementSize(Nc4Notes.TypeNotes ti)
-
getatomicdata
protected Object getatomicdata(dap4.core.dmr.DapType basetype, long lcount, long elemsize, Nc4DSP.Nc4Pointer mem)
-
errcheck
public static void errcheck(ucar.nc2.jni.netcdf.Nc4prototypes nc4, int ret) throws dap4.core.util.DapException- Throws:
dap4.core.util.DapException
-
readcheck
public static void readcheck(ucar.nc2.jni.netcdf.Nc4prototypes nc4, int ret) throws dap4.core.util.DapException- Throws:
dap4.core.util.DapException
-
getVlenType
public Nc4Notes.TypeNotes getVlenType(dap4.core.dmr.DapVariable v)
If the basetype is sequence (=> isVlen()), then return the type of the first field of this sequence. Otherwise return null.- Returns:
- the type of the first field
-
debug
protected void debug()
-
-