Log I/O
|
Class for modeling a DLIS set. More...
Public Member Functions | |
void | AddObject (DlisComponent objectComponent, IList< DlisComponent > values) |
Add an object to this set. | |
DlisSet (string type, string name, IList< DlisComponent > attributes) | |
Create a new empty DLIS set. | |
DlisComponent | FindAttribute (string attributeName) |
Find the DLIS component defining the template for the specified attribute of this set. | |
DlisComponent | FindObject (DlisType objectName) |
Find the DLIS component defining the specified object. | |
DlisComponent | FindObject (string objectName) |
Find the DLIS component defining the specified object. | |
IList< DlisComponent > | GetAttributes () |
Return the attributes of this set. | |
string | GetName () |
Return name of this set. | |
IList< DlisComponent > | GetObjects () |
Return the objects of this set. | |
string | GetSetType () |
Return the type of this set. | |
string | GetUnit (string objectName, string attributeName) |
Return the unit for the values of the given attribute of the specified object. | |
DlisType | GetValue (DlisComponent objectComponent, string attributeName) |
Return a single value for the given attribute of the specified object. | |
DlisType | GetValue (string objectName, string attributeName) |
Return a single value for the given attribute of the specified object. | |
DlisComponent | GetValueComponent (DlisComponent objectComponent, DlisComponent attribute) |
Return the value component of the specified attribute for the given object. | |
DlisComponent | GetValueComponent (DlisComponent objectComponent, string attributeName) |
Return the value component of the specified attribute for the given object. | |
DlisComponent | GetValueComponent (string objectName, string attributeName) |
Return the value component of the specified attribute for the given object. | |
IList< DlisComponent > | GetValues (DlisComponent objectComponent) |
Get all the value components for the specified object in the order the attributes are defined in the set. | |
IList< DlisType > | GetValues (DlisComponent objectComponent, DlisComponent attribute) |
Return the list of values for the given attribute of the specified object. | |
IList< DlisType > | GetValues (DlisComponent objectComponent, string attributeName) |
Return the list of values for the given attribute of the specified object. | |
IList< DlisType > | GetValues (string objectName, string attributeName) |
Return the list of values for the given attribute of the specified object. | |
override string | ToString () |
Class for modeling a DLIS set.
DLIS sets contains meta-data of the logging operation.
A DLIS set has a name, a set of attributes and a number of objects with one or more values for each of the attributes. It can be viewed as a matrix as follows:
attr1 attr2 attr3 ... attrn ---------------------------------------- object1 v11 v12 v13 v1n object2 v21 v22 v23 v2n object3 v31 v32 v33 v3n : objectm vm1 vm2 vm3 vmn ----------------------------------------
The basic access methods are as follows:
// Get the attribute definition of a set IList<DlisComponent> attributes = set.GetAttributes(); // Get the objects of a set IList<DlisComponent> objects = set.GetObjects(); // Get the value for a particular attribute of a given object DlisComponent value = set.GetValueComponent(object, attribute);
In addition, the class contains a number of convenience methods for accessing attributes and objects by name.
See also DlisUtil
which contains convenience methods for accessing sets at a semantic level.
Implementation details:
During a DLIS reading operation the set is instantiated with name component only. Then the components for the attributes are added and then row by row, one component at the time. The order of adding is therefore important, and also the fact that during the process the set may be in an incomplete state.
DlisSet | ( | string | type, |
string | name, | ||
IList< DlisComponent > | attributes ) |
Create a new empty DLIS set.
type | Set type. According to the RP66 manual, the types are dictionary controlled. Please refer to the documentation for valid values. Non-null. |
name | Set name. Often null, but typically used if there are multiple sets of the same type. |
attributes | The attributes definition. Non-null. |
ArgumentNullException | If type or attributes is invalid. |
void AddObject | ( | DlisComponent | objectComponent, |
IList< DlisComponent > | values ) |
Add an object to this set.
objectComponent | Object to add. Non-null. |
values | Values for each of the attributes defined by the set. |
ArgumentNullException | If objectComponent or values is null. |
ArgumentException | If the number of values doesn't match the set definition. |
DlisComponent FindAttribute | ( | string | attributeName | ) |
Find the DLIS component defining the template for the specified attribute of this set.
attributeName | Name of attribute to find. |
ArgumentNullException | If attributeName is null. |
DlisComponent FindObject | ( | DlisType | objectName | ) |
Find the DLIS component defining the specified object.
objectName | DlisType (of type OBNAME) of name of object to find. Non-null. |
ArgumentNullException | If objectName is null. |
DlisComponent FindObject | ( | string | objectName | ) |
Find the DLIS component defining the specified object.
NOTE: If there is more than one object with the same name, the first one is returned.
objectName | Name of object to find. Non-null. |
ArgumentNullException | If objectName is null. |
IList< DlisComponent > GetAttributes | ( | ) |
Return the attributes of this set.
This is the "template", i.e. the definition of which attributes are present with each object.
string GetName | ( | ) |
Return name of this set.
IList< DlisComponent > GetObjects | ( | ) |
Return the objects of this set.
string GetSetType | ( | ) |
Return the type of this set.
The type is dictionary-controlled. See the DLIS documentation for legal ones.
string GetUnit | ( | string | objectName, |
string | attributeName ) |
Return the unit for the values of the given attribute of the specified object.
NOTE: If there are more than one object with the same name, the first of them will be investigated.
objectName | Name of object to investigate. Non-null. |
attributeName | Name of attribute to find unit for. Non-null. |
ArgumentNullException | If objectName or attributeName is null. |
DlisType GetValue | ( | DlisComponent | objectComponent, |
string | attributeName ) |
Return a single value for the given attribute of the specified object.
Convenient if the caller knows that there is only one value in the set. If there is more than one, the first one is returned.
objectComponent | Object to investigate. Non-null. |
attributeName | Name of attribute to find value for. Non-null. |
ArgumentNullException | If objectComponent or attributeName is null. |
DlisType GetValue | ( | string | objectName, |
string | attributeName ) |
Return a single value for the given attribute of the specified object.
Convenient if the caller knows that there is only one value in the set. If there is more than one, the first one is returned.
NOTE: If there are more than one object with the same name, the requested value component for the first of them will be returned.
objectName | Name of object to investigate. Non-null. |
attributeName | Name of attribute to find values for. Non-null. |
ArgumentNullException | If objectName or attributeName is null. |
DlisComponent GetValueComponent | ( | DlisComponent | objectComponent, |
DlisComponent | attribute ) |
Return the value component of the specified attribute for the given object.
objectComponent | Object to investigate. Non-null. |
attribute | Attribute to get value component of. Non-null. |
ArgumentNullException | If objectComponent or attribute is null. |
DlisComponent GetValueComponent | ( | DlisComponent | objectComponent, |
string | attributeName ) |
Return the value component of the specified attribute for the given object.
objectComponent | Object to investigate. Non-null |
attributeName | Name of attribute to get value component of. Non-null. |
ArgumentNullException | If objectComponent or attributeName is null. |
DlisComponent GetValueComponent | ( | string | objectName, |
string | attributeName ) |
Return the value component of the specified attribute for the given object.
NOTE: If there are more than one object with the same name, the requested value component for the first of them will be returned.
objectName | Name of object to investigate. Non-null. |
attributeName | Name of attribute to get value component of. Non-null. |
ArgumentNullException | If objectName or attributeName is null. |
IList< DlisComponent > GetValues | ( | DlisComponent | objectComponent | ) |
Get all the value components for the specified object in the order the attributes are defined in the set.
objectComponent | Object to get values for. Non-null. |
ArgumentNullException | If objectComponent is null. |
IList< DlisType > GetValues | ( | DlisComponent | objectComponent, |
DlisComponent | attribute ) |
Return the list of values for the given attribute of the specified object.
objectComponent | Object to investigate. Non-null. |
attribute | Attribute to find values for. Non-null. |
ArgumentNullException | If objectComponent or attribute is null. |
IList< DlisType > GetValues | ( | DlisComponent | objectComponent, |
string | attributeName ) |
Return the list of values for the given attribute of the specified object.
objectComponent | Object to investigate. Non-null. |
attributeName | Name of attribute to find values for. Non-null. |
ArgumentNullException | If objectComponent or attributeName is null. |
IList< DlisType > GetValues | ( | string | objectName, |
string | attributeName ) |
Return the list of values for the given attribute of the specified object.
the requested value component for the first of them will be returned.
objectName | Name of object to investigate. Non-null. |
attributeName | Name of attribute to find values for. Non-null. |
ArgumentNullException | If objectName or attributeName is null. |