public static class Group.Builder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.List<EnumTypedef> |
enumTypedefs |
java.util.List<Group.Builder> |
gbuilders |
java.lang.String |
shortName |
java.util.List<Variable.Builder<?>> |
vbuilders |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
Group.Builder |
addAttribute(Attribute att) |
Group.Builder |
addAttributes(java.lang.Iterable<Attribute> atts) |
Group.Builder |
addDimension(Dimension dim)
Add Dimension with error if it already exists
|
boolean |
addDimensionIfNotExists(Dimension dim)
Add Dimension if it doesnt already exist
|
Group.Builder |
addDimensions(java.util.Collection<Dimension> dims)
Add Dimensions with error if any already exist
|
Group.Builder |
addEnumTypedef(EnumTypedef typedef) |
Group.Builder |
addEnumTypedefs(java.util.Collection<EnumTypedef> typedefs) |
Group.Builder |
addGroup(Group.Builder nested)
Add a nested Group.
|
Group.Builder |
addGroups(java.util.Collection<Group.Builder> groups) |
Group.Builder |
addVariable(Variable.Builder<?> variable)
Add a Variable, throw error if one of the same name if it exists.
|
Group.Builder |
addVariables(java.util.Collection<Variable.Builder<?>> vars)
Add Variables, throw error if one of the same name if it exists.
|
Group |
build()
Build the root group, with parent = null.
|
Group.Builder |
commonParent(Group.Builder other)
Find the common parent with the other group ?
|
boolean |
contains(Dimension want)
Is the Dimension contained within this Group or a parent Group
|
java.util.Optional<Dimension> |
findDimension(java.lang.String name)
Find Dimension in this Group or a parent Group
|
java.util.Optional<Dimension> |
findDimensionLocal(java.lang.String name)
Find Dimension local to this Group
|
java.util.Optional<EnumTypedef> |
findEnumTypedef(java.lang.String name)
Find a Enumeration in this Group Builder, using its short name.
|
java.util.Optional<EnumTypedef> |
findEnumTypedef(java.lang.String name,
boolean searchup)
Find a Enumeration in this or a parent Group Builder, using its short name.
|
java.util.Optional<Group.Builder> |
findGroupLocal(java.lang.String shortName) |
java.util.Optional<Group.Builder> |
findGroupNested(java.lang.String relativeName)
Find a subgroup of this Group, with the specified relative name.
|
EnumTypedef |
findOrAddEnumTypedef(java.lang.String name,
java.util.Map<java.lang.Integer,java.lang.String> map)
Add a EnumTypedef if it does not already exist.
|
java.util.Optional<EnumTypedef> |
findSimilarEnumTypedef(EnumTypedef template,
boolean searchup)
Locate an enum type definition that is structurally
similar to the template type def.
|
java.util.Optional<Variable.Builder<?>> |
findVariableLocal(java.lang.String name) |
java.util.Optional<Variable.Builder<?>> |
findVariableNested(java.lang.String relativeName)
Find a Variable, with the specified relative name.
|
java.util.Optional<Variable.Builder<?>> |
findVariableOrInParent(java.lang.String varShortName)
Find the Variable with the specified (short) name in this group or a parent group.
|
AttributeContainerMutable |
getAttributeContainer() |
java.lang.Iterable<Dimension> |
getDimensions() |
NetcdfFile |
getNcfile()
Deprecated.
|
Group.Builder |
getParentGroup() |
boolean |
isParent(Group.Builder other)
Is this group a parent of the other group ?
|
void |
makeDimensionMap(Group.Builder parent,
com.google.common.collect.Multimap<Dimension,Variable.Builder<?>> dimUsedMap)
Make a multimap of Dimensions and all the variables that reference them, in this group and its nested groups.
|
com.google.common.collect.ImmutableList<Dimension> |
makeDimensionsList(java.lang.String dimString)
Make list of dimensions by looking in this Group or parent groups
|
java.lang.String |
makeFullName()
Make the full name of the this group.
|
boolean |
removeDimension(java.lang.String name)
Remove dimension, if it exists.
|
void |
removeDimensionFromAllGroups(Group.Builder group,
Dimension remove)
Remove the given dimension from this group and any subgroups
|
boolean |
removeGroup(java.lang.String name)
Remove group, if it exists.
|
boolean |
removeVariable(java.lang.String name)
Remove variable, if it exists.
|
boolean |
replaceDimension(Dimension dim)
Replace dimension if it exists, else just add it.
|
boolean |
replaceVariable(Variable.Builder<?> vb)
Replace variable of same name, if it exists, else just add it.
|
Group.Builder |
setName(java.lang.String shortName) |
Group.Builder |
setNcfile(NetcdfFile ncfile) |
Group.Builder |
setParentGroup(Group.Builder parentGroup) |
public java.util.List<EnumTypedef> enumTypedefs
public java.util.List<Group.Builder> gbuilders
public java.lang.String shortName
public java.util.List<Variable.Builder<?>> vbuilders
public Group.Builder addAttribute(Attribute att)
public Group.Builder addAttributes(java.lang.Iterable<Attribute> atts)
public Group.Builder addDimension(Dimension dim)
public boolean addDimensionIfNotExists(Dimension dim)
public Group.Builder addDimensions(java.util.Collection<Dimension> dims)
public Group.Builder addEnumTypedef(EnumTypedef typedef)
public Group.Builder addEnumTypedefs(java.util.Collection<EnumTypedef> typedefs)
public Group.Builder addGroup(Group.Builder nested)
public Group.Builder addGroups(java.util.Collection<Group.Builder> groups)
public Group.Builder addVariable(Variable.Builder<?> variable)
public Group.Builder addVariables(java.util.Collection<Variable.Builder<?>> vars)
public Group build()
public Group.Builder commonParent(Group.Builder other)
public boolean contains(Dimension want)
public java.util.Optional<Dimension> findDimension(java.lang.String name)
public java.util.Optional<Dimension> findDimensionLocal(java.lang.String name)
public java.util.Optional<EnumTypedef> findEnumTypedef(java.lang.String name)
public java.util.Optional<EnumTypedef> findEnumTypedef(java.lang.String name, boolean searchup)
name
- for which to searchsearchup
- if true, then search this group and then parent groups.public java.util.Optional<Group.Builder> findGroupLocal(java.lang.String shortName)
public java.util.Optional<Group.Builder> findGroupNested(java.lang.String relativeName)
relativeName
- eg "group/subgroup/wantGroup".public EnumTypedef findOrAddEnumTypedef(java.lang.String name, java.util.Map<java.lang.Integer,java.lang.String> map)
public java.util.Optional<EnumTypedef> findSimilarEnumTypedef(EnumTypedef template, boolean searchup)
template
- match this enum type defsearchup
- if true, then search this group and then parent groups.public java.util.Optional<Variable.Builder<?>> findVariableLocal(java.lang.String name)
public java.util.Optional<Variable.Builder<?>> findVariableNested(java.lang.String relativeName)
relativeName
- eg "group/subgroup/varname".public java.util.Optional<Variable.Builder<?>> findVariableOrInParent(java.lang.String varShortName)
varShortName
- short name of Variable.public AttributeContainerMutable getAttributeContainer()
public java.lang.Iterable<Dimension> getDimensions()
@Deprecated public NetcdfFile getNcfile()
@Nullable public Group.Builder getParentGroup()
public boolean isParent(Group.Builder other)
public void makeDimensionMap(Group.Builder parent, com.google.common.collect.Multimap<Dimension,Variable.Builder<?>> dimUsedMap)
public com.google.common.collect.ImmutableList<Dimension> makeDimensionsList(java.lang.String dimString) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String makeFullName()
public boolean removeDimension(java.lang.String name)
public void removeDimensionFromAllGroups(Group.Builder group, Dimension remove)
public boolean removeGroup(java.lang.String name)
public boolean removeVariable(java.lang.String name)
public boolean replaceDimension(Dimension dim)
public boolean replaceVariable(Variable.Builder<?> vb)
public Group.Builder setName(java.lang.String shortName)
public Group.Builder setNcfile(NetcdfFile ncfile)
public Group.Builder setParentGroup(@Nullable Group.Builder parentGroup)