public class Group extends ucar.nc2.CDMNode implements AttributeContainer
Modifier and Type | Class and Description |
---|---|
static class |
Group.Builder
A builder of Groups.
|
Modifier and Type | Method and Description |
---|---|
AttributeContainer |
attributes()
The attributes contained by this Group.
|
static Group.Builder |
builder() |
Group |
commonParent(Group other)
Get the common parent of this and the other group.
|
boolean |
equals(java.lang.Object oo)
Instances which have same name and parent are equal.
|
Attribute |
findAttribute(java.lang.String name)
Find the attribute by name, return null if not exist
|
java.lang.String |
findAttributeString(java.lang.String attName,
java.lang.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(java.lang.String name)
Find a Dimension in this or a parent Group, matching on short name.
|
Dimension |
findDimensionLocal(java.lang.String shortName)
Find a Dimension using its (short) name, in this group only
|
EnumTypedef |
findEnumeration(java.lang.String name)
Find a Enumeration in this Group, using its short name.
|
EnumTypedef |
findEnumeration(java.lang.String name,
boolean searchup)
Find a Enumeration in this or optionally the parent Groups, using its short name.
|
Group |
findGroupLocal(java.lang.String groupShortName)
Retrieve the Group with the specified (short) name.
|
EnumTypedef |
findSimilarEnumTypedef(EnumTypedef template,
boolean searchup)
Locate an enum type definition that is structurally
similar to the template type def.
|
Variable |
findVariableByAttribute(java.lang.String attName,
java.lang.String attValue)
Look in this Group and in its nested Groups for a Variable with a String valued Attribute with the given name
and value.
|
Variable |
findVariableLocal(java.lang.String varShortName)
Find the Variable with the specified (short) name in this group.
|
Variable |
findVariableOrInParent(java.lang.String varShortName)
Find the Variable with the specified (short) name in this group or a parent group.
|
java.util.List<Dimension> |
getDimensions()
Get the shared Dimensions contained directly in this group.
|
com.google.common.collect.ImmutableList<EnumTypedef> |
getEnumTypedefs()
Get the enumerations contained directly in this group.
|
java.lang.String |
getFullName()
Get the full name of this object.
|
com.google.common.collect.ImmutableList<Group> |
getGroups()
Get the Groups contained directly in this Group.
|
java.lang.String |
getNameAndAttributes()
Get String with name and attributes.
|
NetcdfFile |
getNetcdfFile()
Get the owning NetcdfFile
|
Group |
getParentGroup()
Get the parent Group, or null if its the root group.
|
java.util.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?
|
com.google.common.collect.ImmutableList<Dimension> |
makeDimensionsList(java.lang.String dimString)
Create a dimension list using dimension names.
|
Group.Builder |
toBuilder()
Turn into a mutable Builder.
|
java.lang.String |
toString() |
filter, findAttributeDouble, findAttributeIgnoreCase, findAttributeInteger, getName, hasAttribute, hasAttributeIgnoreCase, isEmpty, iterator
public AttributeContainer attributes()
public static Group.Builder builder()
public Group commonParent(Group other)
other
- the other grouppublic boolean equals(java.lang.Object oo)
equals
in class java.lang.Object
@Nullable public Attribute findAttribute(java.lang.String name)
findAttribute
in interface AttributeContainer
public java.lang.String findAttributeString(java.lang.String attName, java.lang.String defaultValue)
findAttributeString
in interface AttributeContainer
@Nullable public Dimension findDimension(Dimension dim)
dim
- Dimension .@Nullable public Dimension findDimension(java.lang.String name)
name
- Dimension name.@Nullable public Dimension findDimensionLocal(java.lang.String shortName)
shortName
- Dimension name.@Nullable public EnumTypedef findEnumeration(java.lang.String name)
@Nullable public EnumTypedef findEnumeration(java.lang.String name, boolean searchup)
@Nullable public Group findGroupLocal(java.lang.String groupShortName)
groupShortName
- short name of the nested group you are looking for.public EnumTypedef findSimilarEnumTypedef(EnumTypedef template, boolean searchup)
template
- match this enum type defsearchup
- if true, then search this group and then parent groups.@Nullable public Variable findVariableByAttribute(java.lang.String attName, java.lang.String attValue)
attName
- look for an Attribuite with this name.attValue
- look for an Attribuite with this value.@Nullable public Variable findVariableLocal(java.lang.String varShortName)
varShortName
- short name of Variable within this group.@Nullable public Variable findVariableOrInParent(java.lang.String varShortName)
varShortName
- short name of Variable.public java.util.List<Dimension> getDimensions()
public com.google.common.collect.ImmutableList<EnumTypedef> getEnumTypedefs()
public java.lang.String getFullName()
getFullName
in class ucar.nc2.CDMNode
public com.google.common.collect.ImmutableList<Group> getGroups()
public java.lang.String getNameAndAttributes()
public NetcdfFile getNetcdfFile()
@Nullable public Group getParentGroup()
getParentGroup
in class ucar.nc2.CDMNode
public java.util.List<Variable> getVariables()
public int hashCode()
hashCode
in class java.lang.Object
public boolean isParent(Group other)
other
- another Grouppublic boolean isRoot()
public com.google.common.collect.ImmutableList<Dimension> makeDimensionsList(java.lang.String dimString) throws java.lang.IllegalArgumentException
dimString
- : 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.public Group.Builder toBuilder()
public java.lang.String toString()
toString
in class java.lang.Object