|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ucar.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 | |
ProtoVariable(java.lang.String name,
java.lang.Class componentType,
Dimension dimension)
Convenience constructor for 1-dimensional Variables, often used for coordinate variables. |
|
ProtoVariable(java.lang.String name,
java.lang.Class componentType,
Dimension[] dimArray)
The usual constructor, used when you are going to add the attributes after construction. |
|
ProtoVariable(java.lang.String name,
java.lang.Class componentType,
Dimension[] dimArray,
Attribute[] attrArray)
More general constructor. |
|
ProtoVariable(Variable var)
Conversion constructor. |
|
| Method Summary | |
java.lang.Object |
clone()
Returns a clone of this |
Attribute |
getAttribute(java.lang.String name)
Convenience function; look up Attribute by name. |
AttributeSet |
getAttributes()
Returns the (modifiable) set of attributes associated with this. |
java.lang.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. |
java.lang.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(java.lang.StringBuffer buf)
Format as CDL. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ProtoVariable(java.lang.String name,
java.lang.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(java.lang.String name,
java.lang.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(java.lang.String name,
java.lang.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.public ProtoVariable(Variable var)
| Method Detail |
public java.lang.Object clone()
clone in class java.lang.Objectpublic final java.lang.String getName()
getName in interface ucar.netcdf.Namedpublic final java.lang.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(java.lang.String name)
name - the name of the attributepublic AttributeSet getAttributes()
public Attribute putAttribute(Attribute attr)
attr - the Attribute to be added to this set.AttributeSet.put(ucar.netcdf.Attribute)public void toCdl(java.lang.StringBuffer buf)
buf - StringBuffer into which to writepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||