Package ucar.nc2
Interface AttributeContainer
-
- All Known Implementing Classes:
AttributeContainerHelper
,AttributeContainerMutable
,CoordinateAxis
,CoordinateAxis1D
,CoordinateAxis1DTime
,CoordinateAxis2D
,CoverageTransform
,DODSGrid
,DODSStructure
,DODSVariable
,Group
,Sequence
,SequenceDS
,Structure
,StructureDS
,StructurePseudo
,StructurePseudo2Dim
,StructurePseudoDS
,Variable
,VariableDS
public interface AttributeContainer extends Iterable<Attribute>
An immutable Container of Attributes. Use AttributeContainerMutable if you want a mutable container.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addAll(Iterable<Attribute> atts)
Deprecated.will be removed in version 6.Attribute
addAttribute(Attribute att)
Deprecated.will be removed in version 6.static AttributeContainer
filter(AttributeContainer atts, String... remove)
Create a new AttributeContainer, removing any whose name starts with one in the given list.Attribute
findAttribute(String attName)
Find an Attribute by exact match on name.double
findAttributeDouble(String attName, double defaultValue)
Find a Numeric Attribute by name (ignore case), return the double value of the Attribute.Attribute
findAttributeIgnoreCase(String attName)
Find an Attribute by name, first doing an exact match, then ignoring case.int
findAttributeInteger(String attName, int defaultValue)
Find a Numeric Attribute by name (ignore case), return the integer value of the Attribute.String
findAttributeString(String attName, String defaultValue)
Find a String Attribute by name (ignore case), return the String value of the Attribute.default String
findAttValueIgnoreCase(String attName, String defaultValue)
Deprecated.use findAttributeString().List<Attribute>
getAttributes()
Deprecated.use IterableString
getName()
Get the (optional) name of the AttributeContainer.default boolean
hasAttribute(String attName)
Determine if named attribute exists (exact match).default boolean
hasAttributeIgnoreCase(String attName)
Determine if named attribute exists, ignoring case.boolean
isEmpty()
True is there are no attributes in the container.default Iterator<Attribute>
iterator()
An unordered iterator over the contained attributes.boolean
remove(Attribute a)
Deprecated.will be removed in version 6.boolean
removeAttribute(String attName)
Deprecated.will be removed in version 6.boolean
removeAttributeIgnoreCase(String attName)
Deprecated.will be removed in version 6.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
filter
static AttributeContainer filter(AttributeContainer atts, String... remove)
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
@Nullable Attribute findAttribute(String attName)
Find an Attribute by exact match on name.
-
hasAttribute
default boolean hasAttribute(String attName)
Determine if named attribute exists (exact match).
-
findAttributeIgnoreCase
@Nullable Attribute findAttributeIgnoreCase(String attName)
Find an Attribute by name, first doing an exact match, then ignoring case.
-
hasAttributeIgnoreCase
default boolean hasAttributeIgnoreCase(String attName)
Determine if named attribute exists, ignoring case.
-
findAttributeDouble
double findAttributeDouble(String attName, double defaultValue)
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
int findAttributeInteger(String attName, int defaultValue)
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
String findAttributeString(String attName, String defaultValue)
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
@Nullable String getName()
Get the (optional) name of the AttributeContainer.
-
iterator
default Iterator<Attribute> iterator()
An unordered iterator over the contained attributes.
-
findAttValueIgnoreCase
@Deprecated default String findAttValueIgnoreCase(String attName, String defaultValue)
Deprecated.use findAttributeString().
-
getAttributes
@Deprecated List<Attribute> getAttributes()
Deprecated.use IterableReturns immutable list of attributes.
-
addAll
@Deprecated void addAll(Iterable<Attribute> atts)
Deprecated.will be removed in version 6.Add all; replace old if has same name
-
addAttribute
@Deprecated Attribute addAttribute(Attribute att)
Deprecated.will be removed in version 6.Add new or replace old if has same name- Parameters:
att
- add this Attribute- Returns:
- the added attribute
-
remove
@Deprecated boolean remove(Attribute a)
Deprecated.will be removed in version 6.Remove an Attribute : uses the attribute hashCode to find it.- Parameters:
a
- remove this attribute- Returns:
- true if was found and removed
-
removeAttribute
@Deprecated boolean removeAttribute(String attName)
Deprecated.will be removed in version 6.Remove an Attribute by name.- Parameters:
attName
- if exists, remove this attribute- Returns:
- true if was found and removed
-
removeAttributeIgnoreCase
@Deprecated boolean removeAttributeIgnoreCase(String attName)
Deprecated.will be removed in version 6.Remove an Attribute by name, ignoring case- Parameters:
attName
- if exists, remove this attribute- Returns:
- true if was found and removed
-
-