|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.netcdf.ProtoVariable
Prototype for Netcdf Variable. Instances of ProtoVariable provide the description of a Netcdf Variable without data i/o functionality. Instances of this class are used in a Schema, which is used when we create a new Netcdf. An instance has a name and a shape specified by an array of Dimensions. It may also have descriptive attributes. The attribute set is modifiable.
The data logically contained in a Netcdf Variable is not accessed through this object.
Although there is no explicit relationship between this class and and Variable, they share common method signatures and semantics where appropriate.
Variable,
Serialized Form| Constructor Summary | |
(package private) |
ProtoVariable(ProtoVariable pv)
copy constructor. |
|
ProtoVariable(String name,
Class componentType,
Dimension dimension)
Convenience constructor for 1-dimensional Variables, often used for coordinate variables. |
|
ProtoVariable(String name,
Class componentType,
Dimension[] dimArray)
The usual constructor, used when you are going to add the attributes after construction. |
|
ProtoVariable(String name,
Class componentType,
Dimension[] dimArray,
Attribute[] attrArray)
More general constructor. |
|
ProtoVariable(Variable var)
Conversion constructor. |
| Method Summary | |
(package private) static boolean |
checkComponentType(Class componentType)
Check if the given Class corresponds to a netcdf type. |
Object |
clone()
Returns a clone of this |
(package private) void |
connectDims(DimensionDictionary dimensions)
Ensure that the dimensions referenced by this are members of the specified Dictionary. |
Attribute |
getAttribute(String name)
Convenience function; look up Attribute by name. |
AttributeSet |
getAttributes()
Returns the (modifiable) set of attributes associated with this. |
Class |
getComponentType()
Returns the Class object representing the component type of the Variable. |
DimensionIterator |
getDimensionIterator()
Returns a DimensionIterator of the dimensions used by this variable. |
int[] |
getLengths()
Return an array whose length is the rank of this and whose elements represent the length of each of its dimensions. |
String |
getName()
Returns the name of this Variable. |
int |
getRank()
Returns the number of dimensions of the variable. |
boolean |
isScalar()
Convenience interface; return true
if and only if the rank is zero. |
boolean |
isUnlimited()
Returns true if and only if the this variable can grow. |
Attribute |
putAttribute(Attribute attr)
Convenience function; add attribute. |
void |
toCdl(StringBuffer buf)
Format as CDL. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ProtoVariable(String name,
Class componentType,
Dimension[] dimArray)
name - String which is to be the name of this VariablecomponentType - Class (primitive type) contained herein.
One of
Character.Type,
Byte.TYPE,
Short.TYPE,
Integer.TYPE,
Float.TYPE,
or
Double.Type.dimArray - The dimensions which define the
shape of this Variable. If null or zero length array,
this is a scalar variable.
public ProtoVariable(String name,
Class componentType,
Dimension dimension)
name - String which is to be the name of this VariablecomponentType - Class (primitive type) contained herein.
One of
Character.Type,
Byte.TYPE,
Short.TYPE,
Integer.TYPE,
Float.TYPE,
or
Double.Type.dimension - A single dimension to define the array.
public ProtoVariable(String name,
Class componentType,
Dimension[] dimArray,
Attribute[] attrArray)
name - String which is to be the name of this VariablecomponentType - Class (primitive type) contained herein.
One of
Character.Type,
Byte.TYPE,
Short.TYPE,
Integer.TYPE,
Float.TYPE,
or
Double.Type.dimArray - The dimensions which define the shape
of this Variable. If null or zero length array,
this is a scalar variable.attrArray - Attributes associated with this Variable.
May be null or a zero length array.ProtoVariable(ProtoVariable pv)
public ProtoVariable(Variable var)
| Method Detail |
static final boolean checkComponentType(Class componentType)
componentType - Class to check
true if Okay, false otherwise.public Object clone()
public final String getName()
getName in interface Namedpublic final Class getComponentType()
getComponentType in interface MultiArrayInfoClass.getComponentType()public final int getRank()
getRank in interface MultiArrayInfopublic final int[] getLengths()
getLengths in interface MultiArrayInfopublic final boolean isUnlimited()
true if and only if the this variable can grow.
This is equivalent to saying
at least one of its dimensions is unlimited.
In the current implementation, exactly one dimension, the most
slowly varying (leftmost), can be unlimited.
isUnlimited in interface MultiArrayInfotrue iff this can growpublic final boolean isScalar()
true
if and only if the rank is zero.
isScalar in interface MultiArrayInfotrue iff rank == 0public DimensionIterator getDimensionIterator()
DimensionIteratorpublic Attribute getAttribute(String name)
name - the name of the attribute
public AttributeSet getAttributes()
public Attribute putAttribute(Attribute attr)
attr - the Attribute to be added to this set.
AttributeSet.put(ucar.netcdf.Attribute)public void toCdl(StringBuffer buf)
buf - StringBuffer into which to writepublic String toString()
void connectDims(DimensionDictionary dimensions)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||