ucar.nc2.dataset
Class StructureDS

java.lang.Object
  extended by ucar.nc2.Variable
      extended by ucar.nc2.Structure
          extended by ucar.nc2.dataset.StructureDS
All Implemented Interfaces:
java.lang.Comparable<VariableSimpleIF>, Enhancements, VariableEnhanced, VariableIF, VariableSimpleIF

public class StructureDS
extends Structure
implements VariableEnhanced

An "enhanced" Structure.

Author:
john caron
See Also:
NetcdfDataset

Field Summary
 
Fields inherited from class ucar.nc2.Variable
defaultSizeToCache
 
Constructor Summary
StructureDS(Group g, Structure orgVar)
          Create a StructureDS thats wraps a Structure
StructureDS(Group group, Structure parent, java.lang.String shortName, Structure orgVar)
          Wrap the given Structure, making it into a StructureDS.
StructureDS(NetcdfDataset ds, Group group, Structure parentStructure, java.lang.String shortName, java.lang.String dims, java.lang.String units, java.lang.String desc)
          Constructor when theres no underlying variable.
 
Method Summary
 void addCoordinateSystem(CoordinateSystem p0)
          Add a CoordinateSystem to the dataset.
 void clearCoordinateSystems()
          clear previous coordinate systems.
 void enhance(java.util.Set<NetcdfDataset.Enhance> mode)
          DO NOT USE DIRECTLY.
 java.util.List<CoordinateSystem> getCoordinateSystems()
          Get the list of Coordinate Systems for this Variable.
 java.lang.String getDescription()
          Get the description of the Variable.
 DataType getOriginalDataType()
          When this wraps another Variable, get the original Variable's DataType.
 java.lang.String getOriginalName()
          When this wraps another Variable, get the original Variable's DataType.
 Variable getOriginalVariable()
          A StructureDS may wrap another Structure.
 ProxyReader getProxyReader()
          Get the proxy reader, or null.
 java.lang.String getUnitsString()
          Get the Unit String for the Variable.
 void removeCoordinateSystem(CoordinateSystem p0)
          Remove a CoordinateSystem from the dataset.
 Structure select(java.util.List<java.lang.String> memberNames)
          Create a subset of the Structure consisting only of the given member variables
 void setName(java.lang.String newName)
          Set the short name
 void setOriginalVariable(Variable orgVar)
          Set the Structure to wrap.
 void setProxyReader(ProxyReader proxyReader)
          Set the proxy reader.
 void setUnitsString(java.lang.String units)
          Set the Unit String for this Variable.
 
Methods inherited from class ucar.nc2.Structure
addMemberVariable, calcElementSize, findVariable, getElementSize, getNameAndAttributes, 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
addAttribute, compareTo, createNewCache, equals, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameEscaped, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShape, getShapeAsSection, getShortName, getSize, getSizeToCache, getSPobject, hasCachedData, hashCode, invalidateCache, isCoordinateVariable, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, lookupEnumString, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setIsScalar, setParentStructure, setSizeToCache, setSPobject, slice, toString, toStringDebug
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.nc2.VariableIF
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getName, getNameAndDimensions, getNameEscaped, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, section, toStringDebug
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

StructureDS

public StructureDS(NetcdfDataset ds,
                   Group group,
                   Structure parentStructure,
                   java.lang.String shortName,
                   java.lang.String dims,
                   java.lang.String units,
                   java.lang.String desc)
Constructor when theres no underlying variable. You better set the values too!

Parameters:
ds - the containing NetcdfDataset.
group - the containing group; if null, use rootGroup
parentStructure - parent Structure, may be null
shortName - variable shortName, must be unique within the Group
dims - list of dimension names, space delimited
units - unit string (may be null)
desc - description (may be null)

StructureDS

public StructureDS(Group g,
                   Structure orgVar)
Create a StructureDS thats wraps a Structure

Parameters:
g - parent group
orgVar - original Structure

StructureDS

public StructureDS(Group group,
                   Structure parent,
                   java.lang.String shortName,
                   Structure orgVar)
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:
group - the containing group; may not be null
parent - parent Structure, may be null
shortName - variable shortName, must be unique within the Group
orgVar - the original Structure to wrap.
Method Detail

select

public Structure select(java.util.List<java.lang.String> memberNames)
Description copied from class: Structure
Create a subset of the Structure consisting only of the given member variables

Overrides:
select in class Structure
Parameters:
memberNames - list of Variable names, already a member
Returns:
Structure containing just those members

getOriginalVariable

public Variable getOriginalVariable()
A StructureDS may wrap another Structure.

Specified by:
getOriginalVariable in interface VariableEnhanced
Returns:
original Structure or null

setOriginalVariable

public void setOriginalVariable(Variable orgVar)
Set the Structure to wrap.

Specified by:
setOriginalVariable in interface VariableEnhanced
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 java.lang.String getOriginalName()
When this wraps another Variable, get the original Variable's DataType.

Specified by:
getOriginalName in interface VariableEnhanced
Returns:
original Variable's DataType

setName

public void setName(java.lang.String newName)
Description copied from class: Variable
Set the short name

Overrides:
setName in class Variable
Parameters:
newName - set to this value

setProxyReader

public void setProxyReader(ProxyReader proxyReader)
Set the proxy reader.

Specified by:
setProxyReader in interface VariableEnhanced
Parameters:
proxyReader - set to this

getProxyReader

public ProxyReader getProxyReader()
Get the proxy reader, or null.

Specified by:
getProxyReader in interface VariableEnhanced
Returns:
return the proxy reader, if any

enhance

public void enhance(java.util.Set<NetcdfDataset.Enhance> mode)
DO NOT USE DIRECTLY. public by accident. recalc any enhancement info

Specified by:
enhance in interface VariableEnhanced

clearCoordinateSystems

public void clearCoordinateSystems()
Description copied from interface: VariableEnhanced
clear previous coordinate systems. if any

Specified by:
clearCoordinateSystems in interface VariableEnhanced

addCoordinateSystem

public void addCoordinateSystem(CoordinateSystem p0)
Description copied from interface: Enhancements
Add a CoordinateSystem to the dataset.

Specified by:
addCoordinateSystem in interface Enhancements
Parameters:
p0 - add this Coordinate System

removeCoordinateSystem

public void removeCoordinateSystem(CoordinateSystem p0)
Description copied from interface: Enhancements
Remove a CoordinateSystem from the dataset.

Specified by:
removeCoordinateSystem in interface Enhancements
Parameters:
p0 - remove this coordinate system

getCoordinateSystems

public java.util.List<CoordinateSystem> getCoordinateSystems()
Description copied from interface: Enhancements
Get the list of Coordinate Systems for this Variable.

Specified by:
getCoordinateSystems in interface Enhancements
Returns:
list of type CoordinateSystem; may be empty but not null.

getDescription

public java.lang.String getDescription()
Description copied from class: Variable
Get the description of the Variable. Default is to use "long_name" attribute value. If not exist, look for "description", "title", or "standard_name" attribute value (in that order).

Specified by:
getDescription in interface Enhancements
Specified by:
getDescription in interface VariableIF
Specified by:
getDescription in interface VariableSimpleIF
Overrides:
getDescription in class Variable
Returns:
description, or null if not found.

getUnitsString

public java.lang.String getUnitsString()
Description copied from class: Variable
Get the Unit String for the Variable. Looks for the "units" attribute value

Specified by:
getUnitsString in interface Enhancements
Specified by:
getUnitsString in interface VariableIF
Specified by:
getUnitsString in interface VariableSimpleIF
Overrides:
getUnitsString in class Variable
Returns:
unit string, or null if not found.

setUnitsString

public void setUnitsString(java.lang.String units)
Description copied from interface: VariableEnhanced
Set the Unit String for this Variable. Default is to use the "units" attribute.

Specified by:
setUnitsString in interface VariableEnhanced
Parameters:
units - unit string