@Immutable public class Dimension extends Object implements Comparable<Dimension>
Note: this class has a natural ordering (sort by name) that is inconsistent with equals.
| Modifier and Type | Class and Description |
|---|---|
static class |
Dimension.Builder |
| Modifier and Type | Field and Description |
|---|---|
static Dimension |
VLEN
A variable-length dimension: the length is not known until the data is read.
|
| Constructor and Description |
|---|
Dimension(String name,
int length)
Default Constructor, shared, not unlimited, not variable length.
|
Dimension(String name,
int length,
boolean isShared,
boolean isUnlimited,
boolean isVariableLength)
General Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Dimension.Builder |
builder() |
static Dimension.Builder |
builder(String name,
int length)
A builder with the Dimension name and length set
|
int |
compareTo(Dimension odim)
Dimensions are compared by name.
|
boolean |
equals(Object o) |
int |
getLength()
Get the length of the Dimension.
|
String |
getShortName()
Get the name of the Dimension.
|
int |
hashCode() |
boolean |
isShared()
If this Dimension is shared, or is private to a Variable.
|
boolean |
isUnlimited()
If this is a NetCDF unlimited dimension.
|
boolean |
isVariableLength()
If variable length, then the length is unknown until the data is read.
|
String |
makeFullName(Group containingGroup)
Make the full name, starting with any group which contains the dimension in itself or a parent group.
|
String |
makeFullName(Variable v)
Make the full name by searching for the containing group starting from the Variable's parent group.
|
Dimension.Builder |
toBuilder()
Turn into a mutable Builder, use toBuilder().build() to make a copy.
|
String |
toString() |
public static final Dimension VLEN
public Dimension(String name, int length)
name - name must be unique within grouplength - length of Dimensionpublic Dimension(String name, int length, boolean isShared, boolean isUnlimited, boolean isVariableLength)
name - name must be unique within group. Can be null/empty only if not shared.length - length, ignored if isVariableLength, >= 0 if unlimited, else > 0.isShared - 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 int getLength()
public String getShortName()
public boolean isUnlimited()
public boolean isVariableLength()
public boolean isShared()
public String makeFullName(Variable v)
IllegalStateException - if not found in one of the Variable's parent groups.public String makeFullName(Group containingGroup)
public int compareTo(Dimension odim)
compareTo in interface Comparable<Dimension>odim - compare to this Dimensionpublic Dimension.Builder toBuilder()
public static Dimension.Builder builder()
public static Dimension.Builder builder(String name, int length)