Package mil.nga.geopackage.db
Class ResultUtils
- java.lang.Object
-
- mil.nga.geopackage.db.ResultUtils
-
public class ResultUtils extends Object
Database Result utilities- Since:
- 3.1.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static int
FIELD_TYPE_BLOB
Blob field typestatic int
FIELD_TYPE_FLOAT
Float field typestatic int
FIELD_TYPE_INTEGER
Integer field typestatic int
FIELD_TYPE_NULL
Null field typestatic int
FIELD_TYPE_STRING
String field type
-
Constructor Summary
Constructors Constructor Description ResultUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<List<Object>>
buildResults(Result result, GeoPackageDataType[] dataTypes, Integer limit)
Build the result rows from the result and the optional limitstatic List<Object>
buildSingleColumnResults(Result result, int column, GeoPackageDataType dataType, Integer limit)
Build single column result rows from the result and the optional limitstatic Object
buildSingleResult(Result result, int column, GeoPackageDataType dataType)
Build single result value from the columnstatic Object
getFloatValue(Result result, int index, GeoPackageDataType dataType)
Get the float value from the cursor of the columnstatic Object
getIntegerValue(Result result, int index, GeoPackageDataType dataType)
Get the integer value from the cursor of the columnstatic Object
getValue(Object value, GeoPackageDataType dataType)
Get the converted value from the value and data typestatic Object
getValue(Result result, int index)
Get the value from the result from the provided columnstatic Object
getValue(Result result, int index, int type)
Get the value from the cursor from the provided columnstatic Object
getValue(Result result, int index, int type, GeoPackageDataType dataType)
Get the value from the cursor from the provided columnstatic Object
getValue(Result result, int index, GeoPackageDataType dataType)
Get the value from the result from the provided column
-
-
-
Field Detail
-
FIELD_TYPE_INTEGER
public static final int FIELD_TYPE_INTEGER
Integer field type- See Also:
- Constant Field Values
-
FIELD_TYPE_FLOAT
public static final int FIELD_TYPE_FLOAT
Float field type- See Also:
- Constant Field Values
-
FIELD_TYPE_STRING
public static final int FIELD_TYPE_STRING
String field type- See Also:
- Constant Field Values
-
FIELD_TYPE_BLOB
public static final int FIELD_TYPE_BLOB
Blob field type- See Also:
- Constant Field Values
-
FIELD_TYPE_NULL
public static final int FIELD_TYPE_NULL
Null field type- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public static Object getValue(Result result, int index)
Get the value from the result from the provided columnAssumes
Result.getType(int)
returns one of:FIELD_TYPE_INTEGER
,FIELD_TYPE_FLOAT
,FIELD_TYPE_STRING
,FIELD_TYPE_BLOB
, orFIELD_TYPE_NULL
- Parameters:
result
- resultindex
- index- Returns:
- value value
-
getValue
public static Object getValue(Result result, int index, GeoPackageDataType dataType)
Get the value from the result from the provided columnAssumes
Result.getType(int)
returns one of:FIELD_TYPE_INTEGER
,FIELD_TYPE_FLOAT
,FIELD_TYPE_STRING
,FIELD_TYPE_BLOB
, orFIELD_TYPE_NULL
- Parameters:
result
- resultindex
- indexdataType
- data type- Returns:
- value value
-
getValue
public static Object getValue(Result result, int index, int type)
Get the value from the cursor from the provided column- Parameters:
result
- resultindex
- indextype
- column type:FIELD_TYPE_INTEGER
,FIELD_TYPE_FLOAT
,FIELD_TYPE_STRING
,FIELD_TYPE_BLOB
, orFIELD_TYPE_NULL
- Returns:
- value value
- Since:
- 3.4.0
-
getValue
public static Object getValue(Result result, int index, int type, GeoPackageDataType dataType)
Get the value from the cursor from the provided column- Parameters:
result
- resultindex
- indextype
- column type:FIELD_TYPE_INTEGER
,FIELD_TYPE_FLOAT
,FIELD_TYPE_STRING
,FIELD_TYPE_BLOB
, orFIELD_TYPE_NULL
dataType
- data type- Returns:
- value value
- Since:
- 3.4.0
-
getIntegerValue
public static Object getIntegerValue(Result result, int index, GeoPackageDataType dataType)
Get the integer value from the cursor of the column- Parameters:
result
- resultindex
- indexdataType
- data type- Returns:
- integer value
-
getFloatValue
public static Object getFloatValue(Result result, int index, GeoPackageDataType dataType)
Get the float value from the cursor of the column- Parameters:
result
- resultindex
- indexdataType
- data type- Returns:
- float value
-
getValue
public static Object getValue(Object value, GeoPackageDataType dataType)
Get the converted value from the value and data type- Parameters:
value
- object valuedataType
- data type- Returns:
- object
- Since:
- 3.4.0
-
buildSingleResult
public static Object buildSingleResult(Result result, int column, GeoPackageDataType dataType)
Build single result value from the column- Parameters:
result
- resultcolumn
- column indexdataType
- GeoPackage data type- Returns:
- value
- Since:
- 3.1.0
-
buildSingleColumnResults
public static List<Object> buildSingleColumnResults(Result result, int column, GeoPackageDataType dataType, Integer limit)
Build single column result rows from the result and the optional limit- Parameters:
result
- resultcolumn
- column indexdataType
- GeoPackage data typelimit
- result row limit- Returns:
- single column results
- Since:
- 3.1.0
-
-