Package ucar.nc2
Interface AttributeContainer
- All Known Implementing Classes:
AttributeContainerMutable,CoordinateAxis,CoordinateAxis1D,CoordinateAxis1DTime,CoordinateAxis2D,Group,Sequence,Structure,StructureDS,StructurePseudo2Dim,StructurePseudoDS,Variable,VariableDS
An immutable Container of Attributes.
Use AttributeContainerMutable if you want a mutable container.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributeContainerfilter(AttributeContainer atts, String... remove) Create a new AttributeContainer, removing any whose name starts with one in the given list.findAttribute(String attName) Find an Attribute by exact match on name.doublefindAttributeDouble(String attName, double defaultValue) Find a Numeric Attribute by name (ignore case), return the double value of the Attribute.findAttributeIgnoreCase(String attName) Find an Attribute by name, first doing an exact match, then ignoring case.intfindAttributeInteger(String attName, int defaultValue) Find a Numeric Attribute by name (ignore case), return the integer value of the Attribute.findAttributeString(String attName, String defaultValue) Find a String Attribute by name (ignore case), return the String value of the Attribute.getName()Get the (optional) name of the AttributeContainer.default booleanhasAttribute(String attName) Determine if named attribute exists (exact match).default booleanhasAttributeIgnoreCase(String attName) Determine if named attribute exists, ignoring case.booleanisEmpty()True is there are no attributes in the container.iterator()An unordered iterator over the contained attributes.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
filter
Create a new AttributeContainer, removing any whose name starts with one in the given list.- Parameters:
atts- Start with this set of Attributes.remove- Remove any whose name starts with one of these.- Returns:
- new AttributeContainer with attributes removed.
-
findAttribute
Find an Attribute by exact match on name. -
hasAttribute
Determine if named attribute exists (exact match). -
findAttributeIgnoreCase
Find an Attribute by name, first doing an exact match, then ignoring case. -
hasAttributeIgnoreCase
Determine if named attribute exists, ignoring case. -
findAttributeDouble
Find a Numeric Attribute by name (ignore case), return the double value of the Attribute.- Returns:
- the attribute value, or defaultValue if not found
-
findAttributeInteger
Find a Numeric Attribute by name (ignore case), return the integer value of the Attribute.- Returns:
- the attribute value, or defaultValue if not found
-
findAttributeString
Find a String Attribute by name (ignore case), return the String value of the Attribute.- Returns:
- the attribute value, or defaultValue if not found
-
isEmpty
boolean isEmpty()True is there are no attributes in the container. -
getName
Get the (optional) name of the AttributeContainer. -
iterator
An unordered iterator over the contained attributes.
-