|
|
ibi Patterns .NET API
|
Manage a set of Variable Attribute values. More...
Public Member Functions |
|
| NetricsVarAttr () | |
| Create an empty set of variable attributes. |
|
| NetricsVarAttr (String[] attr_names, String[] attr_values) | |
| Create a set of variable attributes from a list of names and values. |
|
| NetricsVarAttr (String enc_str) | |
| Create a Variable Attributes set from and encoded string. |
|
| int | setAttr (String name, String val) |
| Add or replace an attribute in a Variable Attribute set. |
|
| String | getAttr (String name) |
| Retrieve the value of a named attribute. |
|
| int | delAttr (String name) |
| Delete a named attribute from the Variable Attributes set. |
|
| String[] | getAllNames () |
| return an array of the names of all attributes in the set. |
|
| String | getEncodedStr () |
| return this Variable Attributes set as an encoded string. |
|
Detailed Description
Manage a set of Variable Attribute values.
This class is used to encode, decode and manipulate a set of Variable Attribute values. A Variable Attribute value is a name value pair. The name is a text string consisting of from 1 to 2048 letters, digits dash or underscore characters. The value is any set of 0 to 50,000 characters. Both are represented in .NET as String values. A set of Variable Attributes is encoded into a block of characters and passed as a single field value in a record.
Constructor & Destructor Documentation
◆ NetricsVarAttr() [1/3]
|
inline |
Create an empty set of variable attributes.
This constructor creates a new set of Variable Attributes with no attributes in it.
◆ NetricsVarAttr() [2/3]
|
inline |
Create a set of variable attributes from a list of names and values.
This constructor creates a new set of Variable Attributes and populates it from a list of attribute names and attributes values.
The following validations are performed:
- length of attr_names != length of attr_values
- any attr_names or attr_values is null
- any attr_names length is < 1 or > 2048
- any attr_names contains invalid characters.
- Parameters
-
attr_names an array of the names of the attributes. attr_values an array of the values for the attributes.
◆ NetricsVarAttr() [3/3]
|
inline |
Create a Variable Attributes set from and encoded string.
This creates a new Variable Attributes set from a string encoded form of a Variable Attributes as created by the getEncodedStr method.
- Parameters
-
enc_str the string encoded Variable Attributes set.
- Exceptions
-
ArgumentException if enc_str is invalid.
- See also
- NetricsVarAttr.getEncodedStr()
for description of the format of the encoded string.
Member Function Documentation
◆ delAttr()
|
inline |
Delete a named attribute from the Variable Attributes set.
This deletes a named attribute from this Variable Attributes set if it exists. It does nothing if it does not exist.
- Parameters
-
name the name of the attribute to be deleted.
- Returns
- 1 if it was deleted, 0 if no such attribute exists.
- Exceptions
-
ArgumentException if name is null.
◆ getAllNames()
|
inline |
return an array of the names of all attributes in the set.
This return a list of the names of all of the attributes in this Variable Attributes set. The names are returned in the order in which they were added to the set.
- Returns
- array of names of each attribute in the set.
◆ getAttr()
|
inline |
Retrieve the value of a named attribute.
This retrieves the value of an attribute from the Variable Attributes set. If the set has no such value null is returned.
- Parameters
-
name the name of the attribute to be retrieved.
- Returns
- the value of the named attribute, null if no such attribute.
- Exceptions
-
ArgumentException if name is null
◆ getEncodedStr()
|
inline |
return this Variable Attributes set as an encoded string.
This encodes all of the attributes in this Variable Attributes set into a single String value and returns that value. The encoded string has the format:
(zero length string if no attributes)
OR
<attr-name>:<attr-value>[;<attr-name>:<attr-value>]*
where attr-name is the attribute name and attr-value is the attribute value with all occurences of ';' changed to ';;'. Names appear in the order they were originally added to this Variable Attributes set.
If there is some error generating the encoded value for an attribute that attribute is simply skipped.
- Returns
- the encoded string as described above.
◆ setAttr()
|
inline |
Add or replace an attribute in a Variable Attribute set.
This adds a new attribute if "name" is not already in this set, or replaces an existing attribute if it is.
- Parameters
-
name the attribute name val the attribute value
- Returns
- 1 if attribute was added, 0 if attribute was replaced
- Exceptions
-
ArgumentException if name is invalid or val is null.