public final class DlisSet extends Object
DLIS sets contains metadata 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:
The basic access methods are 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 ----------------------------------------
In addition, the class contains a number of convenience methods for accessing attributes and objects by name.// Get the attribute definition of a set List<DlisComponent> attributes = set.getAttributes(); // Get the object of a set List<DlisComponent> objects = set.getObjects(); // Get the value for a particular attribute of a given object DlisComponent value = set.getValueComponent(object, attribute);
See also DlisUtil
which contains metadata convenience
methods for accessing sets at a semantic level.
Implementation details:
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.
Constructor and Description |
---|
DlisSet(String type,
String name,
List<DlisComponent> attributes)
Create a new set with the specified attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(DlisComponent object,
List<DlisComponent> values)
Add an object to this set.
|
boolean |
equals(Object object) |
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.
|
List<DlisComponent> |
getAttributes()
Return the attributes of this set.
|
String |
getName()
Return name of this set.
|
List<DlisComponent> |
getObjects()
Return the objects of this set.
|
String |
getType()
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 object,
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 object,
DlisComponent attribute)
Return the value component of the specified attribute for
the given object.
|
DlisComponent |
getValueComponent(DlisComponent object,
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.
|
List<DlisComponent> |
getValues(DlisComponent object)
Get all the value components for the specified object in the
order the attributes are defined in the set.
|
List<DlisType> |
getValues(DlisComponent object,
DlisComponent attribute)
Return the list of values for the given attribute of the specified
object.
|
List<DlisType> |
getValues(DlisComponent object,
String attributeName)
Return the list of values for the given attribute of the specified
object.
|
List<DlisType> |
getValues(String objectName,
String attributeName)
Return the list of values for the given attribute of the specified
object.
|
int |
hashCode() |
String |
toString() |
public DlisSet(String type, String name, List<DlisComponent> attributes)
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.IllegalArgumentException
- If attributes is null.public String getType()
The type is dictionary-controlled. See the DLIS documentation for legal ones.
public String getName()
public List<DlisComponent> getAttributes()
This is the "template", i.e. the definition of which attributes are present with each object.
public List<DlisComponent> getObjects()
public DlisComponent findAttribute(String attributeName)
attributeName
- Name of attribute to find.IllegalArgumentException
- If attributeName is null.public DlisComponent findObject(String objectName)
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.IllegalArgumentException
- If objectName is null.public DlisComponent findObject(DlisType objectName)
objectName
- DlisType (of type OBNAME) of name of
object to find. Non-null.IllegalArgumentException
- If objectName is null.public List<DlisComponent> getValues(DlisComponent object)
object
- Object to get values for. Non-null.IllegalArgumentException
- If object is null.public DlisComponent getValueComponent(DlisComponent object, DlisComponent attribute)
object
- Object to investigate. Non-null.attribute
- Attribute to get value component of. Non-null.IllegalArgumentException
- If object or attribute is null.public DlisComponent getValueComponent(DlisComponent object, String attributeName)
object
- Object to investigate. Non-null.attributeName
- Name of attribute to get value component of. Non-null.IllegalArgumentException
- If object or attributeName is null.public DlisComponent getValueComponent(String objectName, String attributeName)
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.IllegalArgumentException
- If objectName or attributeName is null.public List<DlisType> getValues(DlisComponent object, DlisComponent attribute)
object
- Object to investigate. Non-null.attribute
- Attribute to find values for. Non-null.IllegalArgumentException
- If object or attribute is null.public List<DlisType> getValues(DlisComponent object, String attributeName)
object
- Object to investigate. Non-null.attributeName
- Name of attribute to find values for. Non-null.IllegalArgumentException
- If object or attributeName is null.public List<DlisType> getValues(String objectName, String attributeName)
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
- Object to investigate. Non-null.attributeName
- Name of attribute to find values for. Non-null.IllegalArgumentException
- If objectName or attributeName is null.public DlisType getValue(DlisComponent object, String attributeName)
object
- Object to investigate. Non-null.attributeName
- Name of attribute to find values for. Non-null.IllegalArgumentException
- If object or attributeName is null.public DlisType getValue(String objectName, String attributeName)
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.IllegalArgumentException
- If objectName or attributeName is null.public String getUnit(String objectName, String attributeName)
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.IllegalArgumentException
- If objectName or attributeName is null.public void addObject(DlisComponent object, List<DlisComponent> values)
object
- Object to add. Non-null.values
- Values for each of the attributes defined by the set.IllegalArgumentException
- If object is null, values is null,
or the number of values doesn't match the set definition.Copyright © 2024 Petroware AS - https://petroware.no