public final class DlisCurve extends Object
A log curve consists of measurement data of a specific type. The curve may have one or more dimensions.
Constructor and Description |
---|
DlisCurve(String name,
String unit,
String description,
int representationCode,
int nDimensions)
Create a DLIS log curve.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(int dimension,
Object value)
Add a value to this curve.
|
void |
addValue(Object value)
Add a value to the first dimension of this curve.
|
void |
clear()
Remove all values from this curve.
|
boolean |
equals(Object object) |
String |
getAxisName(int axisNo)
Return name of the specified axis.
|
String |
getDescription()
Return description of this curve.
|
String |
getName()
Return name of this curve.
|
int |
getNAxes()
Return number of axes for a multidimensional curve.
|
int |
getNDimensions()
Return the number of dimensions in this curve.
|
int |
getNDimensions(int axisNo)
Return the number of dimensions along the specified axis.
|
int |
getNValues()
Return the number of values (per dimension) in this curve.
|
Object[] |
getRange()
Return the range (i.e the min and max value) of this curve.
|
int |
getRepresentationCode()
Return the DLIS representation code for the data of this curve.
|
Statistics |
getStatistics()
Return curve statistics.
|
String |
getUnit()
Return unit of measure of the values of this curve.
|
Object |
getValue(int index)
Return a specific value from this curve.
|
Object |
getValue(int[] axisPosition,
int index)
Return a specific value within the specified axis position
at the given index of this curve.
|
Object |
getValue(int dimension,
int index)
Return a specific value from the given dimension of this curve.
|
Class<?> |
getValueType()
Return value type (i.e Java class) of the curve values,
typically Double.class, Integer.class, Date.class etc.
|
int |
hashCode() |
String |
toString() |
public DlisCurve(String name, String unit, String description, int representationCode, int nDimensions)
name
- Name (mnemonic) of curve. Non-null.unit
- Unit of measure for the curve data. Null if unknown or unitless.description
- Curve long name or description. May be null if not provided.representationCode
- Type of curve data. See DlisRepresentationCode
.nDimensions
- Number of dimensions in curve. [1,>.IllegalArgumentException
- If name is null, representation code is invalid or
nDimensions is out of bounds.public String getName()
public String getUnit()
public String getDescription()
public int getRepresentationCode()
This is the internal type of the curve data as defined
by DLIS. It is exposed in the API for information only.
The actual type of the curve data is retrieved from getValueType()
.
public Class<?> getValueType()
public int getNAxes()
public String getAxisName(int axisNo)
axisNo
- Axis to get name of. [0,nAxes>.IllegalArgumentException
- If axisNo is out of bounds.public int getNDimensions()
In case the curve contains multiple axes
(see getNAxes()
) this number is
the Cartesian product of their dimensions.
public int getNDimensions(int axisNo)
axisNo
- Axis to get dimension of. [0,nAxes>.IllegalArgumentException
- If axisNo is out of bounds.public void addValue(int dimension, Object value)
dimension
- Dimension index. [0,nDimensions>value
- Value to add. Null to indicate absent.public void addValue(Object value)
addValue(0, value)
.value
- Value to add. Null to indicate absent.public int getNValues()
public Object getValue(int dimension, int index)
The object returned is of type according to getValueType()
.
dimension
- Dimension index. [0,nDimensions>.index
- Position index. [0,nValues>.public Object getValue(int[] axisPosition, int index)
This is a convenience method for accessing elements within a multidimensional curve with multiple axes.
axisPosition
- Axis position to get value from. Non-null.
Array length must equal getNAxes()
and
index i must be [0, getNDimensions(i)>.index
- Position index. [0,nValues>.IllegalArgumentException
- If axisPoistion is null or has wrong
length or its content is out of bounds, or if index
is out of bounds.public Object getValue(int index)
This is a convenience method if the caller knows that there
is only one dimension in the curve. Equivalent of calling
getValue(0, index)
.
The object returned is of type according to getValueType()
.
index
- Position index. [0,nValues>.public Object[] getRange()
If the curve is multidimensional, the range is reported across all dimensions.
The objects returned is of type according to getValueType()
.
public Statistics getStatistics()
public void clear()
Copyright © 2024 Petroware AS - https://petroware.no