|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.nc2.Dimension
public class Dimension
A Dimension is used to define the array shape of a Variable. It may be shared among Variables, which provides a simple yet powerful way of associating Variables. When a Dimension is shared, it has a unique name within its Group. It may have a coordinate Variable, which gives each index a coordinate value. A private Dimension cannot have a coordinate Variable, so use shared dimensions with coordinates when possible.
Dimensions are considered immutable : do not change them after they have been constructed. Only the Unlimited Dimension can grow.
| Field Summary | |
|---|---|
static Dimension |
UNKNOWN
|
static Dimension |
UNLIMITED
|
| Constructor Summary | |
|---|---|
Dimension(java.lang.String name,
Dimension from)
Copy Constructor used to make global dimensions |
|
Dimension(java.lang.String name,
int length,
boolean isShared)
Constructor |
|
Dimension(java.lang.String name,
int length,
boolean isShared,
boolean isUnlimited,
boolean isVariableLength)
Constructor |
|
| Method Summary | |
|---|---|
void |
addCoordinateVariable(Variable v)
Add a coordinate variable or coordinate variable alias. |
int |
compareTo(java.lang.Object o)
Dimensions with the same name are equal. |
boolean |
equals(java.lang.Object oo)
Instances which have same contents are equal. |
java.util.List |
getCoordinateVariables()
Get the coordinate variables or coordinate variable aliases if the dimension has any, else return an empty list. |
int |
getLength()
Get the length of the Dimension. |
java.lang.String |
getName()
Returns the name of this Dimension; may be null. |
int |
hashCode()
Override Object.hashCode() to implement equals. |
boolean |
isShared()
If this Dimension is shared, or is private to a Variable. |
boolean |
isUnlimited()
If unlimited, then the length can increase; otherwise it is immutable. |
boolean |
isVariableLength()
If variable length, then the length is unknown until the data is read. |
void |
setLength(int n)
Set the Dimension length. |
void |
setName(java.lang.String name)
rename |
void |
setShared(boolean b)
Set whether this is shared. |
void |
setUnlimited(boolean b)
Set whether this is unlimited, meaning length can increase. |
void |
setVariableLength(boolean b)
Set whether the length is variable. |
java.lang.String |
toString()
String representation. |
java.lang.String |
writeCDL(boolean strict)
String representation. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static Dimension UNLIMITED
public static Dimension UNKNOWN
| Constructor Detail |
|---|
public Dimension(java.lang.String name,
int length,
boolean isShared)
name - name must be unique within grouplength - length, or UNLIMITED.length or UNKNOWN.lengthisShared - whether its shared or local to Variable.
public Dimension(java.lang.String name,
int length,
boolean isShared,
boolean isUnlimited,
boolean isVariableLength)
name - name must be unique within group. Can be null only if not shared.length - length, or UNLIMITED.length or UNKNOWN.lengthisShared - whether its shared or local to Variable.isUnlimited - whether the length can grow.isVariableLength - whether the length is unknown until the data is read.
public Dimension(java.lang.String name,
Dimension from)
| Method Detail |
|---|
public java.lang.String getName()
public int getLength()
public boolean isUnlimited()
public boolean isVariableLength()
public boolean isShared()
public java.util.List getCoordinateVariables()
Variable.getCoordinateDimension()public boolean equals(java.lang.Object oo)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableo - compare to this Dimension
public java.lang.String writeCDL(boolean strict)
public void addCoordinateVariable(Variable v)
public void setUnlimited(boolean b)
public void setVariableLength(boolean b)
public void setShared(boolean b)
public void setLength(int n)
public void setName(java.lang.String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||