public class Dimension extends CDMNode implements java.lang.Comparable<Dimension>
Immutable if setImmutable() was called, except for an Unlimited Dimension, whose size can change.
Note: this class has a natural ordering that is inconsistent with equals. TODO Dimension will be immutable in 6. TODO Dimension will not extend CDMNode in 6. TODO Dimension will not have a reference to its owning Group in 6. TODO Dimension.getFullName() will not exist in 6.
Modifier and Type | Class and Description |
---|---|
static class |
Dimension.Builder
A builder of Dimensions.
|
Modifier and Type | Field and Description |
---|---|
static Dimension |
VLEN
A variable-length dimension: the length is not known until the data is read.
|
annotations, dodsname, group, immutable, parentstruct, shortName, sort
Constructor and Description |
---|
Dimension(java.lang.String name,
Dimension from)
Deprecated.
Use Dimension.builder()
|
Dimension(java.lang.String name,
int length)
Constructor
|
Dimension(java.lang.String name,
int length,
boolean isShared)
Deprecated.
Use Dimension.builder()
|
Dimension(java.lang.String name,
int length,
boolean isShared,
boolean isUnlimited,
boolean isVariableLength)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static Dimension.Builder |
builder() |
static Dimension.Builder |
builder(java.lang.String name,
int length)
A builder with the Dimension name and length set
|
int |
compareTo(Dimension odim)
Dimensions with the same name are equal.
|
boolean |
equals(java.lang.Object oo) |
Group |
getGroup()
Deprecated.
Do not use.
|
int |
getLength()
Get the length of the Dimension.
|
java.lang.String |
getName()
Get the name of the Dimension.
|
java.lang.String |
getShortName()
Get the name of the Dimension.
|
int |
hashCode()
Override Object.hashCode() to implement equals.
|
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.
|
static java.util.List<Dimension> |
makeDimensionsAnon(int[] shape)
Deprecated.
use Dimensions.makeDimensionsAnon()
|
static java.util.List<Dimension> |
makeDimensionsList(Group parentGroup,
java.lang.String dimString)
Deprecated.
use Group.makeDimensionsList()
|
static java.util.List<Dimension> |
makeDimensionsList(java.util.List<Dimension> dimensions,
java.lang.String dimString)
Deprecated.
use Dimensions.makeDimensionsList()
|
static java.lang.String |
makeDimensionsString(java.util.List<Dimension> dimensions)
Deprecated.
use Dimensions.makeDimensionsString()
|
java.lang.String |
makeFullName()
Deprecated.
Do not use.
|
void |
setGroup(Group g)
Deprecated.
Use Dimension.builder()
|
Dimension |
setImmutable()
Deprecated.
Use Dimension.builder()
|
void |
setLength(int n)
Deprecated.
Use Dimension.builder()
|
java.lang.String |
setName(java.lang.String name)
Deprecated.
Use Dimension.builder()
|
void |
setShared(boolean b)
Deprecated.
Use Dimension.builder()
|
void |
setUnlimited(boolean b)
Deprecated.
Use Dimension.builder()
|
void |
setVariableLength(boolean b)
Deprecated.
Use Dimension.builder()
|
Dimension.Builder |
toBuilder()
Turn into a mutable Builder, use toBuilder().build() to make a copy.
|
java.lang.String |
toString() |
java.lang.String |
writeCDL(boolean strict)
Deprecated.
use CDLWriter
|
annotate, annotation, getDODSName, getFullName, getFullNameEscaped, getImmutable, getParentGroup, getParentStructure, getSort, isMemberOfStructure, localhash, setDODSName, setParentGroup, setParentStructure, setShortName, setSort, unwrap
public static final Dimension VLEN
public Dimension(java.lang.String name, int length)
name
- name must be unique within grouplength
- length of Dimension@Deprecated 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.@Deprecated public Dimension(java.lang.String name, Dimension from)
name
- name must be unique within group. Can be null only if not shared.from
- copy all other fields from here.@Deprecated public static java.lang.String makeDimensionsString(java.util.List<Dimension> dimensions)
@Deprecated public static java.util.List<Dimension> makeDimensionsList(Group parentGroup, java.lang.String dimString) throws java.lang.IllegalArgumentException
parentGroup
- containing group, may not be nulldimString
- : whitespace separated list of dimension names, or '*' for Dimension.UNKNOWN, or number for anon
dimension. null or empty String is a scalar.java.lang.IllegalArgumentException
- if cant find dimension or parse error.@Deprecated public static java.util.List<Dimension> makeDimensionsList(java.util.List<Dimension> dimensions, java.lang.String dimString)
dimensions
- list of possible dimensions, may not be nulldimString
- : whitespace separated list of dimension names, or '*' for Dimension.UNKNOWN, or number for anon
dimension. null or empty String is a scalar.java.lang.IllegalArgumentException
- if cant find dimension or parse error.@Deprecated public static java.util.List<Dimension> makeDimensionsAnon(int[] shape)
public Dimension.Builder toBuilder()
public int getLength()
public java.lang.String getName()
public java.lang.String getShortName()
getShortName
in class CDMNode
public boolean isUnlimited()
public boolean isVariableLength()
public boolean isShared()
@Deprecated public Group getGroup()
@Deprecated public java.lang.String makeFullName()
public boolean equals(java.lang.Object oo)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Dimension odim)
compareTo
in interface java.lang.Comparable<Dimension>
odim
- compare to this Dimension@Deprecated public java.lang.String writeCDL(boolean strict)
strict
- if true, write in strict adherence to CDL definition.@Deprecated public void setUnlimited(boolean b)
b
- true if unlimited@Deprecated public void setVariableLength(boolean b)
b
- true if variable length@Deprecated public void setShared(boolean b)
b
- true if shared@Deprecated public void setLength(int n)
n
- length of Dimension@Deprecated public java.lang.String setName(java.lang.String name)
name
- set to this value@Deprecated public void setGroup(Group g)
g
- parent group@Deprecated public Dimension setImmutable()
setImmutable
in class CDMNode
public static Dimension.Builder builder()
public static Dimension.Builder builder(java.lang.String name, int length)