ucar.nc2.dataset
Class StructurePseudoDS

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

public class StructurePseudoDS
extends StructureDS

Make a collection of variables with the same outer dimension into a fake Structure. Its fake because the variables are not stored contiguously.

  so
   var1(dim, other);
   var2(dim, other);
   var3(dim, other);
 becomes
   struct {
     var1(other);
     var2(other);
     var3(other);
   } name(dim);
 

Author:
caron

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.Variable
Variable.Cache
 
Field Summary
protected static Set<NetcdfDataset.Enhance> enhanceScaleMissing
           
 
Fields inherited from class ucar.nc2.dataset.StructureDS
orgVar
 
Fields inherited from class ucar.nc2.Structure
defaultBufferSize, isSubset, 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
protected StructurePseudoDS(NetcdfDataset ncfile, Group group, String shortName)
           
  StructurePseudoDS(NetcdfDataset ncfile, Group group, String shortName, List<String> varNames, Dimension outerDim)
          Make a Structure out of all Variables with the named dimension as their outermost dimension, or from a list named Variables, each has the same named outermost dimension.
 
Method Summary
protected  Variable copy()
           
 Array reallyRead(Variable mainv, CancelTask cancelTask)
          public by accident, do not call directly.
 Array reallyRead(Variable mainv, Section section, CancelTask cancelTask)
          public by accident, do not call directly.
 boolean removeMemberVariable(Variable v)
          Remove a Variable : uses the Variable name to find it.
 Structure select(List<String> memberNames)
          Create a subset of the Structure consisting only of the given member variables
 
Methods inherited from class ucar.nc2.dataset.StructureDS
addCoordinateSystem, clearCoordinateSystems, convert, convert, enhance, getCoordinateSystems, getDescription, getOriginalDataType, getOriginalName, getOriginalVariable, getUnitsString, removeCoordinateSystem, setName, setOriginalVariable, setUnitsString
 
Methods inherited from class ucar.nc2.Structure
addMemberVariable, calcElementSize, calcStructureSize, findVariable, getElementSize, getNameAndAttributes, getNumberOfMemberVariables, getStructureIterator, getStructureIterator, getVariableNames, getVariables, isCaching, isSubset, makeStructureMembers, readStructure, readStructure, readStructure, replaceMemberVariable, select, setCaching, setImmutable, setMemberVariables, setParentGroup, writeCDL
 
Methods inherited from class ucar.nc2.Variable
_read, _read, addAttribute, clone, compareTo, createNewCache, equals, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getEnumTypedef, getFullName, getFullNameEscaped, getName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, 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, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setIsScalar, setParentStructure, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, slice, toString, toStringDebug, writeCDL
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.nc2.VariableIF
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getFullName, getFullNameEscaped, getNameAndDimensions, 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 ucar.nc2.VariableSimpleIF
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

enhanceScaleMissing

protected static final Set<NetcdfDataset.Enhance> enhanceScaleMissing
Constructor Detail

StructurePseudoDS

protected StructurePseudoDS(NetcdfDataset ncfile,
                            Group group,
                            String shortName)

StructurePseudoDS

public StructurePseudoDS(NetcdfDataset ncfile,
                         Group group,
                         String shortName,
                         List<String> varNames,
                         Dimension outerDim)
Make a Structure out of all Variables with the named dimension as their outermost dimension, or from a list named Variables, each has the same named outermost dimension.

Parameters:
ncfile - part of this file
group - part of this group
shortName - short name of this Structure
varNames - limited to these variables, all must have dim as outer dimension. If null, use all Variables with that outer dimension
outerDim - existing, outer dimension
Method Detail

copy

protected Variable copy()
Overrides:
copy in class StructureDS

select

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

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

removeMemberVariable

public boolean removeMemberVariable(Variable v)
Description copied from class: Structure
Remove a Variable : uses the Variable name to find it.

Overrides:
removeMemberVariable in class Structure
Parameters:
v - remove this variable as a member of this structure
Returns:
true if was found and removed

reallyRead

public Array reallyRead(Variable mainv,
                        CancelTask cancelTask)
                 throws IOException
Description copied from class: Variable
public by accident, do not call directly.

Specified by:
reallyRead in interface ProxyReader
Overrides:
reallyRead in class StructureDS
Parameters:
mainv - the client Variable
cancelTask - user may cancel
Returns:
Array
Throws:
IOException - on error

reallyRead

public Array reallyRead(Variable mainv,
                        Section section,
                        CancelTask cancelTask)
                 throws IOException,
                        InvalidRangeException
Description copied from class: Variable
public by accident, do not call directly.

Specified by:
reallyRead in interface ProxyReader
Overrides:
reallyRead in class StructureDS
Parameters:
mainv - the client Variable
section - the section of data to read.
cancelTask - user may cancel
Returns:
Array
Throws:
IOException - on error
InvalidRangeException - if section has incorrect rank or illegal shape.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.