Package ucar.nc2
Class AttributeContainerHelper
- java.lang.Object
-
- ucar.nc2.AttributeContainerHelper
-
- All Implemented Interfaces:
Iterable<Attribute>
,AttributeContainer
@Deprecated public class AttributeContainerHelper extends Object implements AttributeContainer
Deprecated.Use AttributeContainerMutable.A mutable collection of Attributes.- Since:
- 5/5/2015
-
-
Constructor Summary
Constructors Constructor Description AttributeContainerHelper(String name)
Deprecated.AttributeContainerHelper(String name, List<Attribute> from)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAll(Iterable<Attribute> atts)
Deprecated.Add all; replace old if has same name.Attribute
addAttribute(String name, Number value)
Deprecated.Add Attribute; name and value must not be null.Attribute
addAttribute(String name, String value)
Deprecated.Add Attribute; name and value must not be null.Attribute
addAttribute(Attribute att)
Deprecated.Add new or replace old if has same namestatic AttributeContainer
filter(AttributeContainer atts, String... remove)
Deprecated.use AttributeContainer.filter().Attribute
findAttribute(String name)
Deprecated.Find an Attribute by exact match on name.double
findAttributeDouble(String attName, double defaultValue)
Deprecated.Find a Numeric Attribute by name (ignore case), return the double value of the Attribute.Attribute
findAttributeIgnoreCase(String name)
Deprecated.Find an Attribute by name, first doing an exact match, then ignoring case.int
findAttributeInteger(String attName, int defaultValue)
Deprecated.Find a Numeric Attribute by name (ignore case), return the integer value of the Attribute.String
findAttributeString(String attName, String defaultValue)
Deprecated.Find a String Attribute by name (ignore case), return the String value of the Attribute.List<Attribute>
getAttributes()
Deprecated.Returns immutable list of attributes.String
getName()
Deprecated.Get the (optional) name of the AttributeContainer.boolean
isEmpty()
Deprecated.True is there are no attributes in the container.boolean
remove(Attribute a)
Deprecated.Remove an Attribute : uses the attribute hashCode to find it.boolean
removeAttribute(String attName)
Deprecated.Remove an Attribute by name.boolean
removeAttributeIgnoreCase(String attName)
Deprecated.Remove an Attribute by name, ignoring casevoid
replace(Attribute a, String newName)
Deprecated.Replace an Attribute with a different name, same value.void
setImmutable()
Deprecated.static void
show(AttributeContainer atts, Indent indent, Formatter f)
Deprecated.AttributeContainer
toImmutable()
Deprecated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.AttributeContainer
findAttValueIgnoreCase, hasAttribute, hasAttributeIgnoreCase, iterator
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
filter
@Deprecated public static AttributeContainer filter(AttributeContainer atts, String... remove)
Deprecated.use AttributeContainer.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.
-
show
@Deprecated public static void show(AttributeContainer atts, Indent indent, Formatter f)
Deprecated.
-
getName
public String getName()
Deprecated.Description copied from interface:AttributeContainer
Get the (optional) name of the AttributeContainer.- Specified by:
getName
in interfaceAttributeContainer
-
setImmutable
@Deprecated public void setImmutable()
Deprecated.
-
isEmpty
public boolean isEmpty()
Deprecated.Description copied from interface:AttributeContainer
True is there are no attributes in the container.- Specified by:
isEmpty
in interfaceAttributeContainer
-
getAttributes
public List<Attribute> getAttributes()
Deprecated.Description copied from interface:AttributeContainer
Returns immutable list of attributes.- Specified by:
getAttributes
in interfaceAttributeContainer
-
addAttribute
public Attribute addAttribute(Attribute att)
Deprecated.Description copied from interface:AttributeContainer
Add new or replace old if has same name- Specified by:
addAttribute
in interfaceAttributeContainer
- Parameters:
att
- add this Attribute- Returns:
- the added attribute
-
addAttribute
public Attribute addAttribute(String name, String value)
Deprecated.Add Attribute; name and value must not be null.
-
addAttribute
public Attribute addAttribute(String name, Number value)
Deprecated.Add Attribute; name and value must not be null.
-
addAll
public void addAll(Iterable<Attribute> atts)
Deprecated.Add all; replace old if has same name.- Specified by:
addAll
in interfaceAttributeContainer
-
findAttributeString
public String findAttributeString(String attName, String defaultValue)
Deprecated.Description copied from interface:AttributeContainer
Find a String Attribute by name (ignore case), return the String value of the Attribute.- Specified by:
findAttributeString
in interfaceAttributeContainer
- Returns:
- the attribute value, or defaultValue if not found
-
findAttribute
public Attribute findAttribute(String name)
Deprecated.Description copied from interface:AttributeContainer
Find an Attribute by exact match on name.- Specified by:
findAttribute
in interfaceAttributeContainer
-
findAttributeIgnoreCase
public Attribute findAttributeIgnoreCase(String name)
Deprecated.Description copied from interface:AttributeContainer
Find an Attribute by name, first doing an exact match, then ignoring case.- Specified by:
findAttributeIgnoreCase
in interfaceAttributeContainer
-
findAttributeDouble
public double findAttributeDouble(String attName, double defaultValue)
Deprecated.Description copied from interface:AttributeContainer
Find a Numeric Attribute by name (ignore case), return the double value of the Attribute.- Specified by:
findAttributeDouble
in interfaceAttributeContainer
- Returns:
- the attribute value, or defaultValue if not found
-
findAttributeInteger
public int findAttributeInteger(String attName, int defaultValue)
Deprecated.Description copied from interface:AttributeContainer
Find a Numeric Attribute by name (ignore case), return the integer value of the Attribute.- Specified by:
findAttributeInteger
in interfaceAttributeContainer
- Returns:
- the attribute value, or defaultValue if not found
-
remove
public boolean remove(Attribute a)
Deprecated.Remove an Attribute : uses the attribute hashCode to find it.- Specified by:
remove
in interfaceAttributeContainer
- Parameters:
a
- remove this attribute- Returns:
- true if was found and removed
-
replace
public void replace(Attribute a, String newName)
Deprecated.Replace an Attribute with a different name, same value.- Parameters:
a
- remove this attribute
-
removeAttribute
public boolean removeAttribute(String attName)
Deprecated.Remove an Attribute by name.- Specified by:
removeAttribute
in interfaceAttributeContainer
- Parameters:
attName
- if exists, remove this attribute- Returns:
- true if was found and removed
-
removeAttributeIgnoreCase
public boolean removeAttributeIgnoreCase(String attName)
Deprecated.Remove an Attribute by name, ignoring case- Specified by:
removeAttributeIgnoreCase
in interfaceAttributeContainer
- Parameters:
attName
- if exists, remove this attribute- Returns:
- true if was found and removed
-
toImmutable
public AttributeContainer toImmutable()
Deprecated.
-
-