public final class JsonCurve extends Object
A log curve consist of measurement data of a specific type. The curve may have one or more dimensions.
Constructor and Description |
---|
JsonCurve(JsonCurve curve,
boolean includeValues)
Create a new JSON Well Log Format curve instance as a copy of the specified one.
|
JsonCurve(String name,
String description,
String quantity,
String unit,
Class<?> valueType,
int nDimensions)
Create a JSON Well Log Format curve instance.
|
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 this curve.
|
void |
clear()
Remove all values from this curve.
|
String |
getDescription()
Return description of this curve.
|
String |
getName()
Return name of this curve.
|
int |
getNDimensions()
Return the number of dimensions of this curve.
|
int |
getNValues()
Return the number of values in this curve.
|
String |
getQuantity()
Return quantity of the data of this curve.
|
Object[] |
getRange()
Return the range (i.e. the min and max value) of this curve.
|
int |
getSize()
Return the size (number of bytes) of the values of this curve when stored
in binary format.
|
Statistics |
getStatistics()
Return curve statistics.
|
String |
getUnit()
Return unit of measure of the data of this curve.
|
Object |
getValue(int index)
Return a specific value from this curve.
|
Object |
getValue(int dimension,
int index)
Return a specific value from the given dimension of this curve.
|
Class<?> |
getValueType()
Return the value type for the data of this curve,
typically Double.class, Integer.class, String.class, etc.
|
void |
setSize(int size)
Specify the (maximum) size (number of bytes) of string values of this curve.
|
String |
toString() |
public JsonCurve(String name, String description, String quantity, String unit, Class<?> valueType, int nDimensions)
name
- Name (mnemonic) of curve. Non-null.description
- Curve long name or description. May be null
if not provided.quantity
- Quantity of the curve data. Null if unknown or N/A.unit
- Unit of measure for the curve data. Null if unitless.valueType
- Value type of curve data.nDimensions
- Dimension of curve. <0,>.IllegalArgumentException
- If name or valueType is or nDimensions is out of bounds.public JsonCurve(JsonCurve curve, boolean includeValues)
curve
- Curve to copy. Non-null.includeValues
- True to include curve values, false to not.IllegalArgumentException
- If curve is null.public String getName()
public String getQuantity()
public String getUnit()
public String getDescription()
public Class<?> getValueType()
public int getNDimensions()
public int getSize()
Note: For string values the number of bytes needed to represent the longest text UTF-8 string of the curve may differ from the number of characters in the string, as each UTF-8 character may take up 1, 2 or 3 bytes.
public void setSize(int size)
Note: For string values the number of bytes needed to represent the longest text UTF-8 string of the curve may differ from the number of characters in the string, as each UTF-8 character may take up 1, 2 or 3 bytes.
size
- Size to set. [0,>.IllegalArgumentException
- If size < 0;IllegalStateException
- If the method is being called for other than
string curves.public void addValue(int dimension, Object value)
dimension
- Dimension index. [0,nDimensions>.value
- Value to add. Null to indicate absent.IllegalArgumentException
- If dimension is out of bounds.public void addValue(Object value)
value
- Value to add. Null indicates absent.public int getNValues()
public Object getValue(int dimension, int index)
dimension
- Dimension index. [0,nDimensions>.index
- Position index. [0,nValues>.public Object getValue(int index)
index
- Position index. [0,nValues>.IllegalArgumentException
- If index is out of bounds.public Object[] getRange()
If the curve is multi-dimensional, the range is reported across all dimensions.
public Statistics getStatistics()
public void clear()
Copyright © 2024 Petroware AS - https://petroware.no