Log I/O
Loading...
Searching...
No Matches
DlisSet Class Referencesealed

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< DlisComponentGetAttributes ()
 Return the attributes of this set.
 
string GetName ()
 Return name of this set.
 
IList< DlisComponentGetObjects ()
 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< DlisComponentGetValues (DlisComponent objectComponent)
 Get all the value components for the specified object in the order the attributes are defined in the set.
 
IList< DlisTypeGetValues (DlisComponent objectComponent, DlisComponent attribute)
 Return the list of values for the given attribute of the specified object.
 
IList< DlisTypeGetValues (DlisComponent objectComponent, string attributeName)
 Return the list of values for the given attribute of the specified object.
 
IList< DlisTypeGetValues (string objectName, string attributeName)
 Return the list of values for the given attribute of the specified object.
 
override string ToString ()
 

Detailed Description

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.

Author
Petroware AS

Constructor & Destructor Documentation

◆ DlisSet()

DlisSet ( string type,
string name,
IList< DlisComponent > attributes )

Create a new empty DLIS set.

Parameters
typeSet type. According to the RP66 manual, the types are dictionary controlled. Please refer to the documentation for valid values. Non-null.
nameSet name. Often null, but typically used if there are multiple sets of the same type.
attributesThe attributes definition. Non-null.
Exceptions
ArgumentNullExceptionIf type or attributes is invalid.

Member Function Documentation

◆ AddObject()

void AddObject ( DlisComponent objectComponent,
IList< DlisComponent > values )

Add an object to this set.

Parameters
objectComponentObject to add. Non-null.
valuesValues for each of the attributes defined by the set.
Exceptions
ArgumentNullExceptionIf objectComponent or values is null.
ArgumentExceptionIf the number of values doesn't match the set definition.

◆ FindAttribute()

DlisComponent FindAttribute ( string attributeName)

Find the DLIS component defining the template for the specified attribute of this set.

Parameters
attributeNameName of attribute to find.
Returns
Requested component, or null if not found.
Exceptions
ArgumentNullExceptionIf attributeName is null.

◆ FindObject() [1/2]

DlisComponent FindObject ( DlisType objectName)

Find the DLIS component defining the specified object.

Parameters
objectNameDlisType (of type OBNAME) of name of object to find. Non-null.
Returns
The requested object, or null if not found.
Exceptions
ArgumentNullExceptionIf objectName is null.

◆ FindObject() [2/2]

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.

Parameters
objectNameName of object to find. Non-null.
Returns
Requested object, or null if not found.
Exceptions
ArgumentNullExceptionIf objectName is null.

◆ GetAttributes()

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.

Returns
The attributes of this set. Never null.

◆ GetName()

string GetName ( )

Return name of this set.

Returns
Name of this set. Null if not defined.

◆ GetObjects()

IList< DlisComponent > GetObjects ( )

Return the objects of this set.

Returns
The objects of this set. Never null.

◆ GetSetType()

string GetSetType ( )

Return the type of this set.

The type is dictionary-controlled. See the DLIS documentation for legal ones.

Returns
The type of this set. Null if not defined.

◆ GetUnit()

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.

Parameters
objectNameName of object to investigate. Non-null.
attributeNameName of attribute to find unit for. Non-null.
Returns
Requested unit. Null if not present.
Exceptions
ArgumentNullExceptionIf objectName or attributeName is null.

◆ GetValue() [1/2]

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.

Parameters
objectComponentObject to investigate. Non-null.
attributeNameName of attribute to find value for. Non-null.
Returns
Requested value. Null if not present.
Exceptions
ArgumentNullExceptionIf objectComponent or attributeName is null.

◆ GetValue() [2/2]

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.

Parameters
objectNameName of object to investigate. Non-null.
attributeNameName of attribute to find values for. Non-null.
Returns
Requested value. Null if not present.
Exceptions
ArgumentNullExceptionIf objectName or attributeName is null.

◆ GetValueComponent() [1/3]

DlisComponent GetValueComponent ( DlisComponent objectComponent,
DlisComponent attribute )

Return the value component of the specified attribute for the given object.

Parameters
objectComponentObject to investigate. Non-null.
attributeAttribute to get value component of. Non-null.
Returns
The requested value component, or null if not found.
Exceptions
ArgumentNullExceptionIf objectComponent or attribute is null.

◆ GetValueComponent() [2/3]

DlisComponent GetValueComponent ( DlisComponent objectComponent,
string attributeName )

Return the value component of the specified attribute for the given object.

Parameters
objectComponentObject to investigate. Non-null
attributeNameName of attribute to get value component of. Non-null.
Returns
The requested value component, or null if not found.
Exceptions
ArgumentNullExceptionIf objectComponent or attributeName is null.

◆ GetValueComponent() [3/3]

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.

Parameters
objectNameName of object to investigate. Non-null.
attributeNameName of attribute to get value component of. Non-null.
Returns
The requested value component, or null if not found.
Exceptions
ArgumentNullExceptionIf objectName or attributeName is null.

◆ GetValues() [1/4]

IList< DlisComponent > GetValues ( DlisComponent objectComponent)

Get all the value components for the specified object in the order the attributes are defined in the set.

Parameters
objectComponentObject to get values for. Non-null.
Returns
The value components of the object. Never null.
Exceptions
ArgumentNullExceptionIf objectComponent is null.

◆ GetValues() [2/4]

IList< DlisType > GetValues ( DlisComponent objectComponent,
DlisComponent attribute )

Return the list of values for the given attribute of the specified object.

Parameters
objectComponentObject to investigate. Non-null.
attributeAttribute to find values for. Non-null.
Returns
List of attribute values. Null if not present.
Exceptions
ArgumentNullExceptionIf objectComponent or attribute is null.

◆ GetValues() [3/4]

IList< DlisType > GetValues ( DlisComponent objectComponent,
string attributeName )

Return the list of values for the given attribute of the specified object.

Parameters
objectComponentObject to investigate. Non-null.
attributeNameName of attribute to find values for. Non-null.
Returns
List of attribute values. Null if not present.
Exceptions
ArgumentNullExceptionIf objectComponent or attributeName is null.

◆ GetValues() [4/4]

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.

Parameters
objectNameName of object to investigate. Non-null.
attributeNameName of attribute to find values for. Non-null.
Returns
List of attribute values. Null if not present.
Exceptions
ArgumentNullExceptionIf objectName or attributeName is null.

The documentation for this class was generated from the following file: