Database Reference
In-Depth Information
IEssMemberCell memberCell = (IEssMemberCell)cell;
System.out.print(memberCell.getDimensionNumber());
}
The result is a grid of dimension numbers in cells that contain Essbase members.
5
4
2
1
1
1
1
3
Likewise, you can cast data cells to an IEssDataCell object and get information about
the cell. For example, you can tell if a data value is read-only or read-write using this
object. to do so, modify the sample code with the following changes:
// get the cell object
IEssCell cell = gv.getCell(row, col);
// if it is a data cell
if (cell.getCellType().equals(IEssCell.EEssCellType.DATA)) {
// cast to a data cell and print the access mode
IEssDataCell dataCell = (IEssDataCell)cell;
System.out.print(dataCell.getAccessMode());
} else if (cell.getCellType().equals(IEssCell.EEssCellType.MEMBER)) {
// just print the member name
System.out.print(cell.getValue());
}
here are the results of this code.
Actual
New York
Sales
Qtr1
Qtr2
Qtr3
Qtr4
Product
Read only
Read only
Read only
Read only
The dimension number of member cells and access mode of data cells are just two of
a number of attributes available for each cell type. The attribute methods available for
the two cell types are shown in tableĀ 8.4.
It would seem that storing each of these attributes for each cell in a large retrieve
would incur a large amount of memory usage. under the covers, however, memory
usage is minimized because all of these attributes are stored in a single integer. This
is possible using a technique called bitmasking. Bitmasking uses each bit, or a series
of bits, in the binary representation of a number to pack different pieces of informa-
tion. If we update our code example once again, we can look at an example of how this
works with attributes in the Java API. Let us change the output line again to write the
attributes.
// get the cell object
IEssCell cell = gv.getCell(row, col);
// if it is a data cell
 
Search WWH ::




Custom Search