ucar.netcdf
Class Dimension
java.lang.Object
|
+--ucar.netcdf.Dimension
- All Implemented Interfaces:
- java.lang.Cloneable, ucar.netcdf.Named, java.io.Serializable
- Direct Known Subclasses:
- UnlimitedDimension
- public class Dimension
- extends java.lang.Object
- implements ucar.netcdf.Named, java.io.Serializable, java.lang.Cloneable
A Dimension object is used to contain an array length which is
named for use in multiple netcdf variables.
This class supports construction, retrieval of the name and retrieval
of the length value. The name is constant over the lifetime of the object.
Also note that change of the dimension length value is not
allowed. In the subclass UnlimitedDimension, the length may be increased.
Instances which have same name and same value are equal.
We override hashCode() and equals() to be consistent with
this semantic.
- See Also:
UnlimitedDimension, Serialized Form
|
Field Summary |
protected int |
length
The length. |
|
Constructor Summary |
Dimension(java.lang.String name,
int length)
|
|
Method Summary |
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object oo)
Instances which have same name and same value are equal. |
int |
getLength()
Retrieve the length. |
java.lang.String |
getName()
Returns the name of this Dimension. |
int |
hashCode()
Instances which have same name and same value are equal. |
void |
toCdl(java.lang.StringBuffer buf)
Format as CDL. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
length
protected int length
- The length. Immutable in this class.
Dimension
public Dimension(java.lang.String name,
int length)
- Parameters:
name - String which is to be the name of this Dimensionlength - int length of this Dimension
hashCode
public int hashCode()
- Instances which have same name and same value are equal.
Overrides Object.hashCode() to be consistent with this semantic.
- Overrides:
hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object oo)
- Instances which have same name and same value are equal.
Overrides Object.hashCode() to be consistent with this semantic.
- Overrides:
equals in class java.lang.Object
clone
public java.lang.Object clone()
- Overrides:
clone in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- a string representation of the object.
getName
public final java.lang.String getName()
- Returns the name of this Dimension.
- Specified by:
getName in interface ucar.netcdf.Named
- Returns:
- String which identifies this Dimension.
getLength
public final int getLength()
- Retrieve the length.
- Returns:
- int which is the length of this Dimension
toCdl
public void toCdl(java.lang.StringBuffer buf)
- Format as CDL.
- Parameters:
buf - StringBuffer into which to write