Package ucar.nc2.dataset
Class StructureDS
- java.lang.Object
-
- ucar.nc2.CDMNode
-
- ucar.nc2.Variable
-
- ucar.nc2.Structure
-
- ucar.nc2.dataset.StructureDS
-
- All Implemented Interfaces:
Comparable<VariableSimpleIF>,Iterable<Attribute>,AttributeContainer,Enhancements,VariableEnhanced,ProxyReader,VariableSimpleIF
- Direct Known Subclasses:
SequenceDS,StructurePseudoDS
public class StructureDS extends Structure implements VariableEnhanced
An "enhanced" Structure.- See Also:
NetcdfDataset
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStructureDS.Builder<T extends StructureDS.Builder<T>>-
Nested classes/interfaces inherited from class ucar.nc2.Variable
Variable.Cache
-
-
Field Summary
Fields Modifier and Type Field Description protected StringorgNameprotected StructureorgVarprotected ucar.nc2.dataset.EnhancementsImplproxy-
Fields inherited from class ucar.nc2.Variable
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, hashCode, isVariableLength, ncfile, permitCaching, proxyReader, shape, sizeToCache, spiObject
-
Fields inherited from class ucar.nc2.CDMNode
annotations, dodsname, group, immutable, parentstruct, shortName, sort
-
-
Constructor Summary
Constructors Modifier Constructor Description StructureDS(NetcdfDataset ds, Group group, Structure parentStructure, String shortName, String dims, String units, String desc)Deprecated.Use StructureDS.builder()StructureDS(NetcdfDataset ds, Group group, Structure parent, String shortName, Structure orgVar)Deprecated.Use StructureDS.builder()protectedStructureDS(StructureDS.Builder<?> builder, Group parentGroup)StructureDS(Group g, Structure orgVar)Deprecated.Use StructureDS.builder()protectedStructureDS(NetcdfFile ncfile, Group group, String shortName)Deprecated.Use StructureDS.builder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCoordinateSystem(CoordinateSystem p0)Deprecated.Use StructureDS.builder()protected StructureDS.Builder<?>addLocalFieldsToBuilder(StructureDS.Builder<? extends StructureDS.Builder<?>> b)static StructureDS.Builder<?>builder()voidclearCoordinateSystems()Deprecated.Use StructureDS.builder()protected ArrayStructureconvert(Array data, Section section)protected StructureDataconvert(StructureData orgData, int recno)protected StructureDScopy()voidenhance(Set<NetcdfDataset.Enhance> mode)Deprecated.do not usecom.google.common.collect.ImmutableList<CoordinateSystem>getCoordinateSystems()Get the list of Coordinate Systems for this Variable.StringgetDescription()Get the description of the Variable.DataTypegetOriginalDataType()When this wraps another Variable, get the original Variable's DataType.StringgetOriginalName()When this wraps another Variable, get the original Variable's DataType.VariablegetOriginalVariable()A StructureDS may wrap another Structure.StringgetUnitsString()Get the Unit String for the Variable.ArrayreallyRead(Variable client, Section section, CancelTask cancelTask)public by accident, do not call directly.ArrayreallyRead(Variable client, CancelTask cancelTask)public by accident, do not call directly.voidremoveCoordinateSystem(CoordinateSystem p0)Deprecated.Use StructureDS.builder()Structureselect(List<String> memberNames)Create a subset of the Structure consisting only of the given member variablesStringsetName(String newName)Deprecated.voidsetOriginalVariable(Variable orgVar)Deprecated.Use StructureDS.builder()voidsetUnitsString(String units)Deprecated.Use StructureDS.builder()StructureDS.Builder<?>toBuilder()Turn into a mutable Builder.-
Methods inherited from class ucar.nc2.Structure
addLocalFieldsToBuilder, addMemberVariable, calcElementSize, calcStructureSize, findVariable, getElementSize, getNameAndAttributes, getNumberOfMemberVariables, getStructureIterator, getStructureIterator, getVariableNames, getVariables, isCaching, isSubset, makeStructureMembers, readStructure, readStructure, readStructure, removeMemberVariable, replaceMemberVariable, select, setCaching, setImmutable, setMemberVariables, setParentGroup, writeCDL
-
Methods inherited from class ucar.nc2.Variable
_read, _read, _readScalarData, addAll, addAttribute, addLocalFieldsToBuilder, attributes, compareTo, createNewCache, equals, extraInfo, findAttribute, findAttributeDouble, findAttributeIgnoreCase, findAttributeInteger, findAttributeString, findDimensionIndex, getAttributes, getDAPName, getDAPName, getDatasetLocation, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getEnumTypedef, getFileTypeId, getFullName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNetcdfFile, getParentGroup, getParentGroupOrRoot, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getSize, getSizeToCache, getSPobject, hasCachedData, hashCode, invalidateCache, isCoordinateVariable, isEmpty, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, isVariableLength, lookupEnumString, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, readToStream, reduce, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setIsScalar, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, slice, toString, toStringDebug, writeCDL
-
Methods inherited from class ucar.nc2.CDMNode
annotate, annotation, getDODSName, getFullNameEscaped, getGroup, getImmutable, getName, getShortName, getSort, localhash, setDODSName, setParentStructure, setShortName, setSort, unwrap
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ucar.nc2.AttributeContainer
findAttValueIgnoreCase, getName, hasAttribute, hasAttributeIgnoreCase, iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface ucar.nc2.dataset.VariableEnhanced
getFullName, getShortName
-
Methods inherited from interface ucar.nc2.VariableSimpleIF
getName, getShortName
-
-
-
-
Constructor Detail
-
StructureDS
@Deprecated protected StructureDS(NetcdfFile ncfile, Group group, String shortName)
Deprecated.Use StructureDS.builder()
-
StructureDS
@Deprecated public StructureDS(NetcdfDataset ds, Group group, Structure parentStructure, String shortName, String dims, String units, String desc)
Deprecated.Use StructureDS.builder()Constructor when theres no underlying variable. You better set the values too!- Parameters:
ds- the containing NetcdfDataset.group- the containing group; if null, use rootGroupparentStructure- parent Structure, may be nullshortName- variable shortName, must be unique within the Groupdims- list of dimension names, space delimitedunits- unit string (may be null)desc- description (may be null)
-
StructureDS
@Deprecated public StructureDS(Group g, Structure orgVar)
Deprecated.Use StructureDS.builder()Create a StructureDS that wraps a Structure- Parameters:
g- parent grouporgVar- original Structure
-
StructureDS
@Deprecated public StructureDS(NetcdfDataset ds, Group group, Structure parent, String shortName, Structure orgVar)
Deprecated.Use StructureDS.builder()Wrap the given Structure, making it into a StructureDS. Delegate data reading to the original variable. Does not share cache, iosp. This is for NcML explicit mode- Parameters:
ds- the containing NetcdfDataset.group- the containing group; may not be nullparent- parent Structure, may be nullshortName- variable shortName, must be unique within the GrouporgVar- the original Structure to wrap.
-
StructureDS
protected StructureDS(StructureDS.Builder<?> builder, Group parentGroup)
-
-
Method Detail
-
copy
protected StructureDS copy()
-
select
public Structure select(List<String> memberNames)
Description copied from class:StructureCreate a subset of the Structure consisting only of the given member variables
-
getOriginalVariable
public Variable getOriginalVariable()
A StructureDS may wrap another Structure.- Specified by:
getOriginalVariablein interfaceVariableEnhanced- Returns:
- original Structure or null
-
setOriginalVariable
@Deprecated public void setOriginalVariable(Variable orgVar)
Deprecated.Use StructureDS.builder()Set the Structure to wrap.- Specified by:
setOriginalVariablein interfaceVariableEnhanced- Parameters:
orgVar- original Variable, must be a Structure
-
getOriginalDataType
public DataType getOriginalDataType()
When this wraps another Variable, get the original Variable's DataType.- Returns:
- original Variable's DataType
-
getOriginalName
public String getOriginalName()
When this wraps another Variable, get the original Variable's DataType.- Specified by:
getOriginalNamein interfaceVariableEnhanced- Returns:
- original Variable's DataType
-
setName
@Deprecated public String setName(String newName)
Deprecated.Description copied from class:VariableSet the short name, converting to valid CDM object name if needed.
-
reallyRead
public Array reallyRead(Variable client, CancelTask cancelTask) throws IOException
Description copied from class:Variablepublic by accident, do not call directly.- Specified by:
reallyReadin interfaceProxyReader- Overrides:
reallyReadin classVariable- Parameters:
client- the client VariablecancelTask- user may cancel- Returns:
- Array
- Throws:
IOException- on error
-
reallyRead
public Array reallyRead(Variable client, Section section, CancelTask cancelTask) throws IOException, InvalidRangeException
Description copied from class:Variablepublic by accident, do not call directly.- Specified by:
reallyReadin interfaceProxyReader- Overrides:
reallyReadin classVariable- Parameters:
client- the client Variablesection- the section of data to read.cancelTask- user may cancel- Returns:
- Array
- Throws:
IOException- on errorInvalidRangeException- if section has incorrect rank or illegal shape.
-
convert
protected ArrayStructure convert(Array data, Section section) throws IOException
- Throws:
IOException
-
convert
protected StructureData convert(StructureData orgData, int recno) throws IOException
- Throws:
IOException
-
enhance
@Deprecated public void enhance(Set<NetcdfDataset.Enhance> mode)
Deprecated.do not useDO NOT USE DIRECTLY. public by accident. recalc any enhancement info- Specified by:
enhancein interfaceVariableEnhanced
-
clearCoordinateSystems
@Deprecated public void clearCoordinateSystems()
Deprecated.Use StructureDS.builder()Description copied from interface:VariableEnhancedclear previous coordinate systems. if any- Specified by:
clearCoordinateSystemsin interfaceVariableEnhanced
-
addCoordinateSystem
@Deprecated public void addCoordinateSystem(CoordinateSystem p0)
Deprecated.Use StructureDS.builder()Description copied from interface:EnhancementsAdd a CoordinateSystem to the dataset.- Specified by:
addCoordinateSystemin interfaceEnhancements- Parameters:
p0- add this Coordinate System
-
removeCoordinateSystem
@Deprecated public void removeCoordinateSystem(CoordinateSystem p0)
Deprecated.Use StructureDS.builder()Description copied from interface:EnhancementsRemove a CoordinateSystem from the dataset.- Specified by:
removeCoordinateSystemin interfaceEnhancements- Parameters:
p0- remove this coordinate system
-
getCoordinateSystems
public com.google.common.collect.ImmutableList<CoordinateSystem> getCoordinateSystems()
Description copied from interface:EnhancementsGet the list of Coordinate Systems for this Variable.- Specified by:
getCoordinateSystemsin interfaceEnhancements- Returns:
- list of type CoordinateSystem; may be empty but not null.
-
getDescription
public String getDescription()
Description copied from class:VariableGet the description of the Variable. Default is to use CDM.LONG_NAME attribute value. If not exist, look for "description", "title", or "standard_name" attribute value (in that order).- Specified by:
getDescriptionin interfaceEnhancements- Specified by:
getDescriptionin interfaceVariableSimpleIF- Overrides:
getDescriptionin classVariable- Returns:
- description, or null if not found.
-
getUnitsString
public String getUnitsString()
Description copied from class:VariableGet the Unit String for the Variable. Looks for the CDM.UNITS attribute value- Specified by:
getUnitsStringin interfaceEnhancements- Specified by:
getUnitsStringin interfaceVariableSimpleIF- Overrides:
getUnitsStringin classVariable- Returns:
- unit string, or null if not found.
-
setUnitsString
@Deprecated public void setUnitsString(String units)
Deprecated.Use StructureDS.builder()Description copied from interface:VariableEnhancedSet the Unit String for this Variable. Default is to use the CDM.UNITS attribute.- Specified by:
setUnitsStringin interfaceVariableEnhanced- Parameters:
units- unit string
-
toBuilder
public StructureDS.Builder<?> toBuilder()
Description copied from class:StructureTurn into a mutable Builder. Can use toBuilder().build() to copy.
-
addLocalFieldsToBuilder
protected StructureDS.Builder<?> addLocalFieldsToBuilder(StructureDS.Builder<? extends StructureDS.Builder<?>> b)
-
builder
public static StructureDS.Builder<?> builder()
-
-