public final class JsonLog extends Object
Constructor and Description |
---|
JsonLog()
Create an empty JSON Well Log Format log instance.
|
JsonLog(JsonLog log,
boolean includeCurveValues)
Create a JSON Well Log Format log instance as a copy of the
specified log.
|
Modifier and Type | Method and Description |
---|---|
void |
addCurve(JsonCurve curve)
Add the specified curve to this log.
|
void |
addTable(JsonTable table)
Add the specified property table to this log.
|
void |
addTable(JsonTable table,
boolean mergeTable)
Add the specified property table to this log.
|
void |
clearCurves()
Clear curve data from all curves of this log.
|
JsonCurve |
findCurve(String curveName)
Return curve of the specified name from this log.
|
int |
findCurveNo(String curveName)
Return curve number of the curve with the specified name.
|
Object |
getActualEndIndex()
Return the actual end index of this log.
|
Object |
getActualStartIndex()
Return the actual start index of this log.
|
Double |
getActualStep()
Return the actual step of the index curve of this log.
|
String |
getCountry()
Return country of this log.
|
JsonCurve |
getCurve(int curveNo)
Return the specified curve from this log.
|
List<JsonCurve> |
getCurves()
Return the curves of this log.
|
String |
getDataUri()
Return URI location of the data object in case this is kept separate.
|
Date |
getDate()
Return logging date of this log.
|
String |
getDescription()
Get description of this log.
|
String |
getElevation()
Return elevation of this log.
|
Object |
getEndIndex()
Return end index of this log.
|
String |
getField()
Return field name of this log.
|
javax.json.JsonObject |
getHeader()
Return the header of this log as a single JSON object.
|
JsonCurve |
getIndexCurve()
Return the index curve of this log.
|
Class<?> |
getIndexValueType()
Return value type of the index of this log, typically Double.class
or Date.class.
|
String |
getName()
Return name of this log.
|
int |
getNCurves()
Return the number of curves in this log.
|
int |
getNValues()
Return the number of values (per curve) in this log.
|
String |
getOperator()
Return operator name of this log.
|
Set<String> |
getProperties()
Return all the header property keys of this log.
|
Object |
getProperty(String key)
Return header property for the specified key.
|
Boolean |
getPropertyAsBoolean(String key)
Return header property for the specified key as a boolean.
|
Date |
getPropertyAsDate(String key)
Return header property for the specified key as date.
|
Double |
getPropertyAsDouble(String key)
Return header property for the specified key as a double.
|
Integer |
getPropertyAsInteger(String key)
Return header property for the specified key as an integer.
|
String |
getPropertyAsString(String key)
Return header property for the specified key as a string.
|
String |
getRunNumber()
Return run number of this log.
|
String |
getServiceCompany()
Return service company name of this log.
|
String |
getSource()
Return the source (system or process) of this log.
|
Object |
getStartIndex()
Return start index of this log.
|
Double |
getStep()
Return the regular step of this log.
|
JsonTable |
getTable(String tableName)
Return property table of the specified name.
|
List<JsonTable> |
getTables()
Return all property tables from the header.
|
String |
getWell()
Return well name of this log.
|
String |
getWellbore()
Return wellbore name of this log.
|
boolean |
hasCurveData()
Return whether the JSON log instance includes curve data
or not, i.e. if only header data was read or created.
|
void |
setCountry(String country)
Set country of this log.
|
void |
setDataUri(String dataUri)
Set URI for the data object in case this is kept separate.
|
void |
setDate(Date date)
Set logging date of this log.
|
void |
setDescription(String description)
Set description of this log.
|
void |
setElevation(double elevation)
Set elevation of this log.
|
void |
setEndIndex(Object endIndex)
Set end index of this log in the header.
|
void |
setField(String field)
Set field name of this log.
|
void |
setHeader(javax.json.JsonObject header)
Set the header of this instance.
|
void |
setName(String name)
Set name of this log.
|
void |
setOperator(String operator)
Set operator name of this log.
|
void |
setProperty(String key,
Object value)
Set a string header property of this log.
|
void |
setRunNumber(String runNumber)
Set run number of this log.
|
void |
setServiceCompany(String serviceCompany)
Set service company name of this log.
|
void |
setSource(String source)
Set source (system or process) of this log.
|
void |
setStartIndex(Object startIndex)
Set start index of this log in header.
|
void |
setStep(Double step)
Set the regular step of the index curve of this log.
|
void |
setWell(String well)
Set well name of this log.
|
void |
setWellbore(String wellbore)
Set wellbore name of this log.
|
String |
toString() |
public JsonLog()
public JsonLog(JsonLog log, boolean includeCurveValues)
log
- Log to copy. Non-null.includeCurveValues
- True to include curve values in the copy, false if not.IllegalArgumentException
- If log is null.public boolean hasCurveData()
public void setHeader(javax.json.JsonObject header)
header
- JSON header object. Non-null.IllegalArgumentException
- If header is null.public javax.json.JsonObject getHeader()
public void setProperty(String key, Object value)
key
- Key of property to set. Non-null.value
- Associated value. Null to unset. Must be of type
BigDecimal, BigInteger, Boolean, Double, Integer,
Long, String, Date or JsonValue.IllegalArgumentException
- If key is null or value is not of a
legal primitive type.public Set<String> getProperties()
public Object getProperty(String key)
This is a generic method for clients that knows custom content of the well log. It is up to the client program to parse the returned content into the appropriate type.
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public String getPropertyAsString(String key)
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public Double getPropertyAsDouble(String key)
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public Integer getPropertyAsInteger(String key)
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public Boolean getPropertyAsBoolean(String key)
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public Date getPropertyAsDate(String key)
key
- Key of property to get. Non-null.IllegalArgumentException
- If key is null.public List<JsonTable> getTables()
public JsonTable getTable(String tableName)
tableName
- Name of property table to get.IllegalArgumentException
- If tableName is null.public void addTable(JsonTable table)
table
- Table to add. Non-null.IllegalArgumentException
- If table is null or a table with the
same name already exists.public void addTable(JsonTable table, boolean mergeTable)
table
- Table to add. Non-null.mergeTable
- True if should merge new table with existing table. Otherwise
addTable(table)
is called.IllegalArgumentException
- If table is null or mergeTable is false
and a table with the same name already exists.IllegalStateException
- If table cannot be merged.public String getName()
public void setName(String name)
name
- Name to set. Null to unset.public String getDescription()
public void setDescription(String description)
description
- Description to set. Null to unset.public String getWell()
public void setWell(String well)
well
- Well name to set. Null to unset.public String getWellbore()
public void setWellbore(String wellbore)
wellbore
- Wellbore name to set. Null to unset.public String getField()
public void setField(String field)
field
- Field name to set. Null to unset.public String getCountry()
public void setCountry(String country)
country
- Country to set. Null to unset.public Date getDate()
public void setDate(Date date)
date
- Logging date to set. Null to unset.public String getOperator()
public void setOperator(String operator)
operator
- Operator name to set. Null to unset.public String getServiceCompany()
public void setServiceCompany(String serviceCompany)
serviceCompany
- Service company name of this log. Null to unset.public String getRunNumber()
public void setRunNumber(String runNumber)
runNumber
- Run number of this log. Null to unset.public String getElevation()
public void setElevation(double elevation)
elevation
- Elevation of this log. Null to unset.public String getSource()
public void setSource(String source)
source
- Source of this log. Null to unset.public String getDataUri()
public void setDataUri(String dataUri)
dataUri
- URI to the data object. Null if data is kept local.public Class<?> getIndexValueType()
public Object getStartIndex()
NOTE: This property is taken from the header, and may not necessarily be in accordance with the actual data of the log.
public Object getActualStartIndex()
public void setStartIndex(Object startIndex)
startIndex
- Start index to set. Null to unset. The type should
be in accordance with the actual type of the index curve
of the log.public Object getEndIndex()
NOTE: This property is taken from header, and may not necessarily be in accordance with the actual data of the log.
public Object getActualEndIndex()
public void setEndIndex(Object endIndex)
endIndex
- End index to set. Null to unset. The type should
be in accordance with the actual type of the index curve
of the log.public Double getStep()
NOTE: This property is taken from header, and may not necessarily be in accordance with the actual data on the file.
public Double getActualStep()
public void setStep(Double step)
step
- Step to set. Null to indicate unknown or that the index is irregular.
If the log set is time based, the step should be the number
of milliseconds between samples.public void addCurve(JsonCurve curve)
curve
- Curve to add. Non-null.IllegalArgumentException
- If curve is null.public List<JsonCurve> getCurves()
public JsonCurve getCurve(int curveNo)
curveNo
- Curve number of curve to return. [0,nCurves>.IllegalArgumentException
- If curveNo is out of bound.public JsonCurve findCurve(String curveName)
If there happens to be more than one curve with this name the first one encountered is returned.
curveName
- Name of curve to find.IllegalArgumentException
- If curveName is null.public int findCurveNo(String curveName)
If there happens to be more than one curve with this name the first one encountered is returned.
curveName
- Name of curve to find.IllegalArgumentException
- If curveName is null.public int getNCurves()
public int getNValues()
public JsonCurve getIndexCurve()
public void clearCurves()
Copyright © 2024 Petroware AS - https://petroware.no