本文整理汇总了Java中org.olap4j.Cell.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.getValue方法的具体用法?Java Cell.getValue怎么用?Java Cell.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.olap4j.Cell
的用法示例。
在下文中一共展示了Cell.getValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: emitCell
import org.olap4j.Cell; //导入方法依赖的package包/类
private void emitCell(SaxWriter writer, Cell cell) throws OlapException {
++cellOrdinal;
Util.discard(cellOrdinal);
// Ignore empty cells.
final Object cellValue = cell.getValue();
if (cellValue == null) {
return;
}
writer.startElement("row");
for (ColumnHandler columnHandler : columnHandlers) {
columnHandler.write(writer, cell, members);
}
writer.endElement();
}
示例2: next
import org.olap4j.Cell; //导入方法依赖的package包/类
@Override
public List<?> next() throws TranslatorException {
if (!rowPositionIterator.hasNext()) {
return null;
}
Position rowPosition = rowPositionIterator.next();
Object[] result = new Object[colWidth];
int i = 0;
// add in rows axis
List<Member> members = rowPosition.getMembers();
for (Member member:members) {
String columnName = member.getName();
result[i++] = columnName;
}
// add col axis
for (Position colPos : columnsAxis) {
Cell cell = cellSet.getCell(colPos, rowPosition);
result[i++] = cell.getValue();
}
if (returnsArray) {
ArrayList<Object[]> results = new ArrayList<Object[]>(1);
results.add(result);
return results;
}
return Arrays.asList(result);
}
示例3: parseCellDataElement
import org.olap4j.Cell; //导入方法依赖的package包/类
protected void parseCellDataElement(CellSet result) throws JRException
{
if (log.isDebugEnabled())
{
log.debug("COLUMNS axis size: " + result.getAxes().get(Axis.COLUMNS.axisOrdinal())
.getPositions().size());
log.debug("ROWS axis size: " + result.getAxes().get(Axis.ROWS.axisOrdinal())
.getPositions().size());
}
for (Position axis_1 : result.getAxes().get(Axis.ROWS.axisOrdinal()).getPositions())
{
for (Position axis_0 : result.getAxes().get(Axis.COLUMNS.axisOrdinal()).getPositions())
{
Cell currentCell = result.getCell(axis_0, axis_1);
if (currentCell.isError())
{
handleCellErrors(currentCell);
}
else
{
int cellOrdinal = currentCell.getOrdinal();
Object value = currentCell.getValue();
if (value instanceof Number)
{
try
{
value = currentCell.getDoubleValue();
}
catch (OlapException e)
{
throw new JRException(e);
}
}
String fmtValue = currentCell.getFormattedValue();
JRXmlaCell cell = new JRXmlaCell(value, fmtValue);
if (log.isDebugEnabled())
{
log.debug("Cell: " + cellOrdinal + ", at axis 0 pos: " + axis_0.getOrdinal() + ", axis 1 pos: " + axis_1.getOrdinal());
}
xmlaResult.setCell(cell, cellOrdinal);
}
}
}
}
示例4: handleCellErrors
import org.olap4j.Cell; //导入方法依赖的package包/类
protected void handleCellErrors(Cell currentCell) throws JRException
{
log.error(currentCell.getValue());
throw new JRException((OlapException) currentCell.getValue());
}
示例5: Olap4jCell
import org.olap4j.Cell; //导入方法依赖的package包/类
public Olap4jCell(Cell cell)
{
this.value = cell.getValue();
this.formattedValue = cell.getFormattedValue();
}