|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.Variable
ucar.nc2.Structure
ucar.nc2.Sequence
public class Sequence
Sequence is a one-dimensional Structure with indeterminate length. The only data access is through getStructureIterator(). However, read() will read in the entire data and return an ArraySequence.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ucar.nc2.Variable |
---|
Variable.Cache |
Field Summary |
---|
Fields inherited from class ucar.nc2.Structure |
---|
defaultBufferSize, isSubset, log, memberHash, members |
Fields inherited from class ucar.nc2.Variable |
---|
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, group, hashCode, isMetadata, isVariableLength, ncfile, parent, proxyReader, shape, shapeAsSection, shortName, sizeToCache, spiObject |
Constructor Summary | |
---|---|
Sequence(NetcdfFile ncfile,
Group group,
Structure parent,
String shortName)
|
Method Summary | |
---|---|
StructureDataIterator |
getStructureIterator(int bufferSize)
Get an efficient iterator over all the data in the Structure. |
Array |
read(int[] origin,
int[] shape)
UnsupportedOperation |
Array |
read(List<Range> ranges)
UnsupportedOperation |
Array |
read(Section section)
UnsupportedOperation |
Array |
read(String sectionSpec)
UnsupportedOperation |
StructureData |
readStructure()
UnsupportedOperation |
StructureData |
readStructure(int index)
UnsupportedOperation |
ArrayStructure |
readStructure(int start,
int count)
UnsupportedOperation |
Variable |
section(Section subsection)
UnsupportedOperation |
Variable |
slice(int dim,
int value)
UnsupportedOperation |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Sequence(NetcdfFile ncfile, Group group, Structure parent, String shortName)
Method Detail |
---|
public StructureDataIterator getStructureIterator(int bufferSize) throws IOException
Structure
Example: StructureDataIterator ii = structVariable.getStructureIterator(100 * 1000); while (ii.hasNext()) { StructureData sdata = ii.next(); }
getStructureIterator
in class Structure
bufferSize
- size in bytes to buffer, set < 0 to use default size
IOException
- on read errorpublic Array read(int[] origin, int[] shape) throws IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
origin
- int array specifying the starting index. If null, assume all zeroes.shape
- int array specifying the extents in each dimension.
This becomes the shape of the returned Array.
UnsupportedOperationException
IOException
InvalidRangeException
public Array read(String sectionSpec) throws IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
sectionSpec
- specification string, eg "1:2,10,:,1:100:10". May optionally have ().
UnsupportedOperationException
IOException
InvalidRangeException
for sectionSpec syntax
public Array read(List<Range> ranges) throws IOException, InvalidRangeException
read
in class Variable
ranges
- list of Range specifying the section of data to read.
UnsupportedOperationException
IOException
- if error
InvalidRangeException
- if ranges is invalidVariable.read(Section)
public Array read(Section section) throws IOException, InvalidRangeException
read
in interface VariableIF
read
in class Variable
section
- list of Range specifying the section of data to read.
Must be null or same rank as variable.
If list is null, assume all data.
Each Range corresponds to a Dimension. If the Range object is null, it means use the entire dimension.
UnsupportedOperationException
IOException
- if error
InvalidRangeException
- if section is invalidpublic StructureData readStructure() throws IOException
readStructure
in class Structure
UnsupportedOperationException
IOException
- on read errorpublic StructureData readStructure(int index) throws IOException, InvalidRangeException
readStructure
in class Structure
index
- index into 1D array
UnsupportedOperationException
IOException
- on read error
InvalidRangeException
- if index out of rangepublic ArrayStructure readStructure(int start, int count) throws IOException, InvalidRangeException
readStructure
in class Structure
start
- start at this indexcount
- return this many StructureData
UnsupportedOperationException
IOException
- on read error
InvalidRangeException
- if start, count out of rangepublic Variable slice(int dim, int value) throws InvalidRangeException
slice
in class Variable
dim
- which dimension to fixvalue
- at what index value
UnsupportedOperationException
InvalidRangeException
- if dimension or value is illegalpublic Variable section(Section subsection) throws InvalidRangeException
section
in class Variable
subsection
- Section of this variable.
Each Range in the section corresponds to a Dimension, and specifies the section of data to read in that Dimension.
A Range object may be null, which means use the entire dimension.
UnsupportedOperationException
InvalidRangeException
- if section not compatible with shape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |