public class AttributeContainerHelper extends Object implements AttributeContainer
Constructor and Description |
---|
AttributeContainerHelper(String name) |
AttributeContainerHelper(String name,
List<Attribute> from) |
Modifier and Type | Method and Description |
---|---|
void |
addAll(Iterable<Attribute> atts)
Add all; replace old if has same name
|
Attribute |
addAttribute(Attribute att)
Add new or replace old if has same name
|
static AttributeContainer |
filter(AttributeContainer atts,
String... remove) |
Attribute |
findAttribute(String name) |
Attribute |
findAttributeIgnoreCase(String name) |
String |
findAttValueIgnoreCase(String attName,
String defaultValue)
Find a String-valued Attribute by Attribute name (ignore case), return the (string) value of the Attribute.
|
List<Attribute> |
getAttributes()
Returns the list of attributes for this variable.
|
String |
getName() |
boolean |
remove(Attribute a)
Remove an Attribute : uses the attribute hashCode to find it.
|
boolean |
removeAttribute(String attName)
Remove an Attribute by name.
|
boolean |
removeAttributeIgnoreCase(String attName)
Remove an Attribute by name, ignoring case
|
void |
setImmutable() |
static void |
show(AttributeContainer atts,
Indent indent,
Formatter f) |
public AttributeContainerHelper(String name)
public String getName()
getName
in interface AttributeContainer
public void setImmutable()
public List<Attribute> getAttributes()
AttributeContainer
getAttributes
in interface AttributeContainer
public Attribute addAttribute(Attribute att)
AttributeContainer
addAttribute
in interface AttributeContainer
att
- add this Attributepublic void addAll(Iterable<Attribute> atts)
addAll
in interface AttributeContainer
public String findAttValueIgnoreCase(String attName, String defaultValue)
AttributeContainer
findAttValueIgnoreCase
in interface AttributeContainer
public Attribute findAttribute(String name)
findAttribute
in interface AttributeContainer
public Attribute findAttributeIgnoreCase(String name)
findAttributeIgnoreCase
in interface AttributeContainer
public boolean remove(Attribute a)
remove
in interface AttributeContainer
a
- remove this attributepublic boolean removeAttribute(String attName)
removeAttribute
in interface AttributeContainer
attName
- if exists, remove this attributepublic boolean removeAttributeIgnoreCase(String attName)
removeAttributeIgnoreCase
in interface AttributeContainer
attName
- if exists, remove this attributepublic static AttributeContainer filter(AttributeContainer atts, String... remove)
public static void show(AttributeContainer atts, Indent indent, Formatter f)