public class Sequence extends Structure
Modifier and Type | Class and Description |
---|---|
static class |
Sequence.Builder<T extends Sequence.Builder<T>>
A builder of Sequences
|
defaultCoordsSizeToCache, defaultSizeToCache, permitCaching
Constructor and Description |
---|
Sequence(NetcdfFile ncfile,
Group group,
Structure parent,
String shortName)
Deprecated.
use Builder.
|
Modifier and Type | Method and Description |
---|---|
static Sequence.Builder<?> |
builder()
Get Builder for this class that allows subclassing.
|
StructureDataIterator |
getStructureIterator(int bufferSize)
Get an efficient iterator over all the data in the Structure.
|
Array |
read(int[] origin,
int[] shape)
Read a section of the data for this Variable and return a memory resident Array.
|
Array |
read(List<Range> ranges)
Read a section of the data for this Variable from the netcdf file and return a memory resident Array.
|
Array |
read(Section section)
Read a section of the data for this Variable from the netcdf file and return a memory resident Array.
|
Array |
read(String sectionSpec)
Read data section specified by a "section selector", and return a memory resident Array.
|
StructureData |
readStructure()
Use this when this is a scalar Structure.
|
StructureData |
readStructure(int index)
Use this when this is a one dimensional array of Structures, or you are doing the index calculation yourself for
a multidimension array.
|
ArrayStructure |
readStructure(int start,
int count)
For rank 1 array of Structures, read count Structures and return the data as an ArrayStructure.
|
Variable |
section(Section subsection)
Create a new Variable that is a logical subsection of this Variable.
|
Variable |
slice(int dim,
int value)
Create a new Variable that is a logical slice of this Variable, by
fixing the specified dimension at the specified index value.
|
Sequence.Builder<?> |
toBuilder()
Turn into a mutable Builder.
|
addMemberVariable, calcElementSize, findVariable, getElementSize, getNameAndAttributes, getNumberOfMemberVariables, getStructureIterator, getVariableNames, getVariables, isCaching, isSubset, makeStructureMembers, removeMemberVariable, replaceMemberVariable, select, select, setCaching, setImmutable, setMemberVariables, setParentGroup
addAll, addAttribute, attributes, compareTo, createNewCache, equals, findAttribute, findAttributeDouble, findAttributeIgnoreCase, findAttributeInteger, findAttValueIgnoreCase, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDatasetLocation, getDataType, getDescription, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getEnumTypedef, getFileTypeId, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNetcdfFile, getParentGroup, getProxyReader, getRanges, getRank, getShape, getShape, getShapeAll, getShapeAsSection, getSize, getSizeToCache, getSPobject, getUnitsString, hasCachedData, hashCode, invalidateCache, isCoordinateVariable, isImmutable, isMetadata, isScalar, isUnknownLength, isUnlimited, isVariableLength, lookupEnumString, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, readToStream, reallyRead, reallyRead, reduce, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setIsScalar, setName, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, toString, toStringDebug, writeCDL
annotate, annotation, getDODSName, getFullName, getFullNameEscaped, getGroup, getImmutable, getName, getParentStructure, getShortName, getSort, isMemberOfStructure, localhash, setDODSName, setParentStructure, setShortName, setSort, unwrap
getFullName, getName, getShortName
getName, hasAttribute, iterator
forEach, spliterator
@Deprecated public Sequence(NetcdfFile ncfile, Group group, Structure parent, String shortName)
ncfile
- the containing NetcdfFile.group
- the containing group; if null, use rootGroupparent
- parent Structure, may be nullshortName
- variable shortName, must be unique within the Grouppublic 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 sizeIOException
- on read errorpublic Array read(int[] origin, int[] shape)
Variable
assert(origin[ii] + shape[ii]*stride[ii] <= Variable.shape[ii]);
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
- alwayspublic Array read(String sectionSpec)
Variable
read
in class Variable
sectionSpec
- specification string, eg "1:2,10,:,1:100:10". May optionally have ().UnsupportedOperationException
- alwaysfor sectionSpec syntax
public Array read(List<Range> ranges)
Variable
read
in class Variable
ranges
- list of Range specifying the section of data to read.UnsupportedOperationException
- alwaysVariable.read(Section)
public Array read(Section section) throws IOException
Variable
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.IOException
- if errorpublic StructureData readStructure()
Structure
readStructure
in class Structure
UnsupportedOperationException
- alwayspublic StructureData readStructure(int index)
Structure
readStructure
in class Structure
index
- index into 1D arrayUnsupportedOperationException
- alwayspublic ArrayStructure readStructure(int start, int count)
Structure
readStructure
in class Structure
start
- start at this indexcount
- return this many StructureDataUnsupportedOperationException
- alwayspublic Variable slice(int dim, int value)
Variable
slice
in class Variable
dim
- which dimension to fixvalue
- at what index valueUnsupportedOperationException
- alwayspublic Variable section(Section subsection)
Variable
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
- alwayspublic Sequence.Builder<?> toBuilder()
public static Sequence.Builder<?> builder()