public class Group extends CDMNode implements AttributeContainer
| Modifier and Type | Class and Description |
|---|---|
static class |
Group.Builder
A builder of Groups.
|
| Constructor and Description |
|---|
Group(NetcdfFile ncfile,
Group parent,
String shortName)
Deprecated.
Use Group.builder()
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(Iterable<Attribute> atts)
Deprecated.
Use Group.builder()
|
Attribute |
addAttribute(Attribute att)
Deprecated.
Use Group.builder()
|
void |
addDimension(Dimension dim)
Deprecated.
Use Group.builder()
|
boolean |
addDimensionIfNotExists(Dimension dim)
Deprecated.
Use Group.builder()
|
void |
addEnumeration(EnumTypedef e)
Deprecated.
Use Group.builder()
|
void |
addGroup(Group g)
Deprecated.
Use Group.builder()
|
void |
addVariable(Variable v)
Deprecated.
Use Group.builder()
|
AttributeContainer |
attributes() |
static Group.Builder |
builder(Group.Builder parent) |
Group |
commonParent(Group other)
Get the common parent of this and the other group.
|
boolean |
equals(Object oo)
Instances which have same name and parent are equal.
|
Attribute |
findAttribute(String name)
Find the attribute by name, return null if not exist
|
double |
findAttributeDouble(String attName,
double defaultValue)
Deprecated.
Use attributes()
|
Attribute |
findAttributeIgnoreCase(String name)
Deprecated.
Use attributes()
|
int |
findAttributeInteger(String attName,
int defaultValue)
Deprecated.
Use attributes()
|
String |
findAttValueIgnoreCase(String attName,
String defaultValue)
Find a String-valued Attribute by name (ignore case), return the String value of the Attribute.
|
Dimension |
findDimension(Dimension dim)
Find a Dimension in this or a parent Group, using equals.
|
Dimension |
findDimension(String name)
Retrieve a Dimension using its (short) name.
|
Dimension |
findDimensionLocal(String shortName)
Retrieve a Dimension using its (short) name, in this group only
|
EnumTypedef |
findEnumeration(String name)
Find an Enumeration Typedef using its (short) name.
|
Group |
findGroup(String groupShortName)
Retrieve the Group with the specified (short) name.
|
Variable |
findVariable(String varShortName)
Find the Variable with the specified (short) name in this group.
|
Variable |
findVariableOrInParent(String varShortName)
Find the Variable with the specified (short) name in this group or a parent group.
|
List<Attribute> |
getAttributes()
Deprecated.
Use attributes()
|
List<Dimension> |
getDimensions()
Get the shared Dimensions contained directly in this group.
|
List<EnumTypedef> |
getEnumTypedefs()
Get the enumerations contained directly in this group.
|
List<Group> |
getGroups()
Get the Groups contained directly in this Group.
|
String |
getNameAndAttributes()
Get String with name and attributes.
|
NetcdfFile |
getNetcdfFile()
Get the owning NetcdfFile
|
Group |
getParentGroup()
Get its parent Group, or null if its the root group.
|
String |
getShortName()
Get the "short" name, unique within its parent Group.
|
List<Variable> |
getVariables()
Get the Variables contained directly in this group.
|
int |
hashCode()
Override Object.hashCode() to implement equals.
|
boolean |
isParent(Group other)
Is this a parent of the other Group?
|
boolean |
isRoot()
Is this the root group?
|
List<Dimension> |
makeDimensionsList(String dimString)
Create a dimension list using dimension names.
|
Group |
makeRelativeGroup(NetcdfFile ncf,
String path,
boolean ignorelast)
Deprecated.
do not use
|
boolean |
remove(Attribute a)
Deprecated.
Use Group.builder()
|
boolean |
remove(Dimension d)
Deprecated.
Use Group.builder()
|
boolean |
remove(Group g)
Deprecated.
Use Group.builder()
|
boolean |
remove(Variable v)
Deprecated.
Use Group.builder()
|
boolean |
removeAttribute(String attName)
Deprecated.
Use Group.builder()
|
boolean |
removeAttributeIgnoreCase(String attName)
Deprecated.
Use Group.builder()
|
boolean |
removeDimension(String dimName)
Deprecated.
Use Group.builder()
|
boolean |
removeVariable(String shortName)
Deprecated.
Use Group.builder()
|
Group |
setImmutable()
Deprecated.
Use Group.builder()
|
String |
setName(String shortName)
Deprecated.
Use Group.builder()
|
void |
setParentGroup(Group parent)
Deprecated.
Use Group.builder()
|
Group.Builder |
toBuilder()
Turn into a mutable Builder.
|
String |
toString() |
String |
writeCDL(boolean strict)
Deprecated.
use CDLWriter
|
annotate, annotation, getDODSName, getFullName, getFullNameEscaped, getGroup, getImmutable, getName, getParentStructure, getSort, isMemberOfStructure, localhash, setDODSName, setParentStructure, setShortName, setSort, unwrapgetName, hasAttribute, iteratorforEach, spliterator@Deprecated public Group(NetcdfFile ncfile, Group parent, String shortName)
ncfile - NetcdfFile owns this Groupparent - parent of Group. If null, this is the root Group.shortName - short name of Group.public boolean isRoot()
public String getShortName()
getShortName in class CDMNodepublic List<Variable> getVariables()
public Variable findVariable(String varShortName)
varShortName - short name of Variable within this group.public Variable findVariableOrInParent(String varShortName)
varShortName - short name of Variable.@Nullable public Group getParentGroup()
getParentGroup in class CDMNodepublic List<Group> getGroups()
public NetcdfFile getNetcdfFile()
public Group findGroup(String groupShortName)
groupShortName - short name of the nested group you are looking for.public List<Dimension> getDimensions()
public List<Dimension> makeDimensionsList(String dimString) throws IllegalArgumentException
dimString - : whitespace separated list of dimension names, or '*' for Dimension.UNKNOWN, or number for anon
dimension. null or empty String is a scalar.IllegalArgumentException - if cant find dimension or parse error.public List<EnumTypedef> getEnumTypedefs()
public Dimension findDimension(String name)
name - Dimension name.public Dimension findDimension(Dimension dim)
dim - Dimension .public Dimension findDimensionLocal(String shortName)
shortName - Dimension name.public AttributeContainer attributes()
@Nullable public Attribute findAttribute(String name)
findAttribute in interface AttributeContainerpublic String findAttValueIgnoreCase(String attName, String defaultValue)
findAttValueIgnoreCase in interface AttributeContainer@Deprecated public List<Attribute> getAttributes()
AttributeContainergetAttributes in interface AttributeContainer@Deprecated public Attribute findAttributeIgnoreCase(String name)
AttributeContainerfindAttributeIgnoreCase in interface AttributeContainer@Deprecated public double findAttributeDouble(String attName, double defaultValue)
AttributeContainerfindAttributeDouble in interface AttributeContainer@Deprecated public int findAttributeInteger(String attName, int defaultValue)
AttributeContainerfindAttributeInteger in interface AttributeContainer@Deprecated public Attribute addAttribute(Attribute att)
AttributeContaineraddAttribute in interface AttributeContaineratt - add this Attribute@Deprecated public void addAll(Iterable<Attribute> atts)
AttributeContaineraddAll in interface AttributeContainer@Deprecated public boolean remove(Attribute a)
AttributeContainerremove in interface AttributeContainera - remove this attribute@Deprecated public boolean removeAttribute(String attName)
AttributeContainerremoveAttribute in interface AttributeContainerattName - if exists, remove this attribute@Deprecated public boolean removeAttributeIgnoreCase(String attName)
AttributeContainerremoveAttributeIgnoreCase in interface AttributeContainerattName - if exists, remove this attributepublic EnumTypedef findEnumeration(String name)
name - Enumeration name.public Group commonParent(Group other)
other - the other grouppublic boolean isParent(Group other)
other - another Grouppublic String getNameAndAttributes()
@Deprecated public String writeCDL(boolean strict)
strict - if true, write in strict adherence to CDL definition.@Deprecated public void setParentGroup(Group parent)
setParentGroup in class CDMNodeparent - parent group.@Deprecated public String setName(String shortName)
shortName - set to this value@Deprecated public void addDimension(Dimension dim)
dim - the dimension to add.IllegalStateException - if this dimension is immutable.IllegalArgumentException - if dim isn't shared or a dimension with dim's name already
exists within the group.@Deprecated public boolean addDimensionIfNotExists(Dimension dim)
dim - the dimension to add.true if dim was successfully added to the group. Otherwise, false will be returned,
meaning that a dimension with dim's name already exists within the group.IllegalStateException - if this dimension is immutable.IllegalArgumentException - if dim isn't shared.@Deprecated public void addGroup(Group g)
g - add this Group.@Deprecated public void addEnumeration(EnumTypedef e)
e - add this Enumeration.@Deprecated public void addVariable(Variable v)
v - add this Variable.@Deprecated public boolean remove(Dimension d)
d - remove this Dimension.@Deprecated public boolean remove(Group g)
g - remove this Group.@Deprecated public boolean remove(Variable v)
v - remove this Variable.@Deprecated public boolean removeDimension(String dimName)
dimName - Dimension name.@Deprecated public boolean removeVariable(String shortName)
shortName - Variable name.@Deprecated public Group setImmutable()
setImmutable in class CDMNodepublic boolean equals(Object oo)
public int hashCode()
@Deprecated public Group makeRelativeGroup(NetcdfFile ncf, String path, boolean ignorelast)
ncf - the containing netcdf file objectpath - the path to the desired groupignorelast - true => ignore last element in the pathpublic Group.Builder toBuilder()
public static Group.Builder builder(@Nullable Group.Builder parent)