public class NetricsVarAttr
extends java.lang.Object
Constructor and Description |
---|
NetricsVarAttr()
Create an empty set of variable attributes.
|
NetricsVarAttr(java.lang.String enc_str)
Create a Variable Attributes set from and encoded string.
|
NetricsVarAttr(java.lang.String[] attr_names,
java.lang.String[] attr_values)
Create a set of variable attributes from a list of names and values.
|
Modifier and Type | Method and Description |
---|---|
int |
delAttr(java.lang.String name)
Delete a named attribute from the Variable Attributes set.
|
java.lang.String[] |
getAllNames()
return an array of the names of all attributes in the set.
|
java.lang.String |
getAttr(java.lang.String name)
Retrieve the value of a named attribute.
|
java.lang.String |
getEncodedStr()
return this Variable Attributes set as an encoded string.
|
int |
setAttr(java.lang.String name,
java.lang.String value)
Add or replace an attribute in a Variable Attribute set.
|
public NetricsVarAttr()
public NetricsVarAttr(java.lang.String[] attr_names, java.lang.String[] attr_values) throws java.lang.IllegalArgumentException
attr_names
- an array of the names of the attributes.attr_values
- an array of the values for the attributes.java.lang.IllegalArgumentException
- if any validation fails.public NetricsVarAttr(java.lang.String enc_str) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException, java.lang.NullPointerException
enc_str
- the string encoded Variable Attributes set.java.lang.IllegalArgumentException
- if enc_str is invalid.java.lang.IndexOutOfBoundsException
- should never be thrown.java.lang.NullPointerException
- should never be thrown.for description of format of the encoded string.
public int setAttr(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException, java.lang.NullPointerException
name
- the attribute namevalue
- the attribute valuejava.lang.IllegalArgumentException
- if name is invalid or value is null.java.lang.NullPointerException
- should never be thrown.public java.lang.String getAttr(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of the attribute to be retrieved.java.lang.IllegalArgumentException
- if name is null.public int delAttr(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the name of the attribute to be deleted.java.lang.IllegalArgumentException
- if name is null.public java.lang.String[] getAllNames()
public java.lang.String getEncodedStr() throws java.lang.IndexOutOfBoundsException, java.lang.NullPointerException
java.lang.IndexOutOfBoundsException
- this should never be thrown.java.lang.NullPointerException
- this should never be thrown.