public final class AscCurve extends Object
Constructor and Description |
---|
AscCurve(String name,
String quantity,
String unit,
String description,
Class<?> valueType)
Create a new curve instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(Object value)
Add a value to this curve.
|
void |
addValue(String value)
Add a value to this curve.
|
String |
getDescription()
Return description of this curve.
|
String |
getName()
Return name of this curve.
|
int |
getNValues()
Return the number of values in this curve.
|
String |
getQuantity()
Get quantity of this curve.
|
Object[] |
getRange()
Return range (i.e min and max) of this curve.
|
String |
getUnit()
Return unit of the values of this curve.
|
Object |
getValue(int index)
Return curve value of the specified index.
|
List<Object> |
getValues()
Return the values of this curve.
|
Class<?> |
getValueType()
Return value type of this curve.
|
String |
toString() |
String |
toString(Object value)
Return a string representation of the specified value
formatted according to all the values of this curve.
|
public AscCurve(String name, String quantity, String unit, String description, Class<?> valueType)
name
- Curve name. Non-null.quantity
- Data quantity. Null if unknown or N/A.unit
- Data unit. May be null if unknown or unitless.description
- Curve description. May be null.valueType
- Data type of the values of this curve. Non-null.IllegalArgumentException
- If name of valueType is null.public String getName()
public String getQuantity()
public String getUnit()
public String getDescription()
public Class<?> getValueType()
public void addValue(String value)
value
- Value to add. May be null to
indicate no-value or absent.public void addValue(Object value)
value
- Value to add. May be null to
indicate no-value or absent.public List<Object> getValues()
public int getNValues()
public Object getValue(int index)
index
- Index to return value from. [0,nValues-1].IndexOutOfBoundsException
- If index is less than 0 or
larger or equal to n.public Object[] getRange()
public String toString(Object value)
value
- Value to format. May be null to indicate absent,
in case an empty string is returned.Copyright © 2024 Petroware AS - https://petroware.no