org.olap4j
Modifier and Type | Method and Description |
---|---|
ResultSet |
drillThrough()
Drills through from this cell to the underlying fact table data,
and returns a
ResultSet of the results. |
CellSet |
getCellSet()
Returns the
CellSet that this Cell belongs to. |
List<Integer> |
getCoordinateList()
Returns the coordinates of this Cell in its
CellSetAxis . |
double |
getDoubleValue()
Returns the value of this cell as a
double value. |
String |
getErrorText()
Returns the error message of this Cell, or null if the cell is not
in error.
|
String |
getFormattedValue()
Returns the value of this Cell, formatted according to the
FORMAT_STRING property and using the numeric formatting tokens the
current locale.
|
int |
getOrdinal()
Returns the ordinal of this Cell.
|
Object |
getPropertyValue(Property property)
Returns the value of a given property for this Cell.
|
Object |
getValue()
Returns the value of this Cell.
|
boolean |
isEmpty()
Returns whether this cell is empty.
|
boolean |
isError()
Returns whether an error occurred while evaluating this cell.
|
boolean |
isNull()
Returns whether the value of this cell is NULL.
|
void |
setValue(Object value,
AllocationPolicy allocationPolicy,
Object... allocationArgs)
Sets the value of a cell.
|
CellSet getCellSet()
CellSet
that this Cell belongs to.int getOrdinal()
The formula is the sequence, zero-based, which the cell would be
visited in a raster-scan through all of the cells of this
CellSet
. The ordinal of the first cell is zero, and the
ordinal of the last cell is the product of the lengths of the axes, minus
1. For example, if a result has 10 columns and 20
rows, then:
List<Integer> getCoordinateList()
CellSetAxis
.
This method is provided for convenience. It is equivalent to the following code:
getResult().ordinalToCoordinateList(getOrdinal())
Object getPropertyValue(Property property)
The list of allowable properties may be obtained by calling
CellSet.getMetaData()
followed by
CellSetMetaData.getCellProperties()
.
Every cell has certain system properties such as "VALUE" and
"FORMAT_STRING" (the full list is described in the
Property.StandardCellProperty
enumeration), as well as extra properties defined by the query.
property
- Property whose value to retrieveboolean isEmpty()
boolean isError()
boolean isNull()
double getDoubleValue() throws OlapException
double
value.
Not all values can be represented as using the Java
double
, therefore for some providers, getValue()
may return a more accurate result.
0
OlapException
- if this cell does not have a numeric valueString getErrorText()
If the cell is an error, the value will be an OlapException
.
(This value is returned, not thrown.)
Object getValue()
If the cell is an error, the value will be an OlapException
.
(This value is returned, not thrown.)
If the cell has a numeric value, returns an object which implements
the Number
interface.
getDoubleValue()
String getFormattedValue()
The formatted value is never null. In particular, when the cell
contains the MDX NULL value, getValue()
will return the Java
null
value but this method will return the empty string
""
.
ResultSet drillThrough() throws OlapException
ResultSet
of the results.
If drill-through is not possible, returns null.
OlapException
- if a database error occursvoid setValue(Object value, AllocationPolicy allocationPolicy, Object... allocationArgs) throws OlapException
When this method may be called depends on the provider. But typically,
the connection must at least have an active scenario; see
OlapConnection.setScenario(Scenario)
.
The number and type of additional arguments specified in the
allocationArgs
parameter depends on the allocation policy chosen.
Some policies, such as AllocationPolicy.EQUAL_ALLOCATION
, do not
require any additional arguments, in which case allocationArgs
may be null
.
value
- Cell valueallocationPolicy
- Allocation policyallocationArgs
- Allocation policy argumentsOlapException
- if a database error occurs