|
Oracle® OLAP Java API Reference 11g Release 1 (11.1) B28128-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CompoundCursor
A Cursor for a Source that has outputs. A CompoundCursor has a child base ValueCursor, the elements of which have the values specified by the Source. A CompoundCursor also has one or more outputs, one for each output of the Source. The outputs of the CompoundCursor are child CompoundCursor or ValueCursor objects.
The order of the outputs of a CompoundCursor is determined by the order of the outputs of the Source. The value of the base ValueCursor at any position in a CompoundCursor is determined by the set of the values of the elements of the outputs specified by that position.
For example, in the following code unitPrice is the Source for an MdmMeasure, and prodHier and calHier are StringSource objects for the default MdmLevelHierarchy objects for the Product and Time dimensions, which are the dimensions of the measure.
Source productsSel =
prodHier.selectValues(new String[] {"PROD_HIER::PRODUCT::1701",
"PROD_HIER::PRODUCT::1815",
"PROD_HIER::PRODUCT::1936",
"PROD_HIER::PRODUCT::2054"};
Source timesSel =
calHier.selectValues(new String[] {"CAL_HIER::DAY::14-JUN-99",
"CAL_HIER::DAY::14-JUN-00"};
Source productsPriceForDay = unitPrice.join(productsSel).join(timesSel);
The productsPriceForDay Source specifies the price of the selected products on the selected days. It has the unitPrice values as element values, and it has productsSel and timesSel as outputs. The following code creates a CursorManager and a Cursor for productsPriceForDay. The dp object is the DataProvider.
CursorManager cursorManager = dp.createCursorManager(productsPriceForDay); Cursor result = cursorManager.createCursor();
Because the productsPriceForDay has outputs, result is a CompoundCursor. The base ValueCursor has the values from unitPrice that are specified by the set of the values of the outputs. The outputs of the CompoundCursor are two ValueCursor objects. The first output has the element values of timesSel and the second output has the element values of productsSel.
The following table is a display of the values of result, formatted into columns. The table shows the current value of each ValueCursor at each position of the CompoundCursor. The left column has the values of the ValueCursor for the first output, the middle column has values of the ValueCursor for the second output, and right column has the values of the base ValueCursor. The display contains only the local values of the dimensions, not the three-part unique values.
14-JUN-99 1701 56.00
14-JUN-99 1815 276.50
14-JUN-99 1936 10.00
14-JUN-99 2054 112.00
14-JUN-00 1701 44.80
14-JUN-00 1815 316.00
14-JUN-00 1936 10.00
14-JUN-00 2054 160.40
The following table shows the positions of the CompoundCursor and the child Cursor objects and the value at each ValueCursor position. The left column has the positions of the parent CompoundCursor. The second column from the left has the positions of the ValueCursor for timesSel and the values at those positions. The third column from the left has the positions of the ValueCursor for productsSel and the values at those positions. The right column has the positions of the base ValueCursor and the values at those positions.
CompoundCursor Output 1 Output 2 Base ValueCursor
-------------- -------------------- ---------------- -----------------
Position Position Value Position Value Position Value
-------- -------- --------- -------- ----- -------- ------
1 1 14-JUN-99 1 1701 1 56.00
2 1 14-JUN-99 2 1815 1 276.50
3 1 14-JUN-99 3 1936 1 10.00
4 1 14-JUN-99 4 2054 1 112.00
5 2 14-JUN-00 1 1701 1 44.80
6 2 14-JUN-00 2 1815 1 316.00
7 2 14-JUN-00 3 1936 1 10.00
8 2 14-JUN-00 4 2054 1 106.40
In the example, each set of output values specifies only one unit price value. The base ValueCursor therefore has only one position for each set of output values.
| Field Summary |
|---|
| Fields inherited from interface oracle.olapi.data.cursor.Cursor |
|---|
FETCH_SIZE_NOT_SPECIFIED |
| Method Summary | |
|---|---|
java.util.List |
getOutputs()Gets the outputs of the CompoundCursor. |
ValueCursor |
getValueCursor()Gets the base ValueCursor of the CompoundCursor. |
| Methods inherited from interface oracle.olapi.data.cursor.Cursor |
|---|
getExtent, getFetchSize, getParentEnd, getParentStart, getPosition, getSource, next, setFetchSize, setPosition |
| Method Detail |
|---|
ValueCursor getValueCursor()
ValueCursor of the CompoundCursor. The base ValueCursor has the values of the Source for the CompoundCursor.ValueCursor of the CompoundCursor.java.util.List getOutputs()
CompoundCursor. An output is a ValueCursor or a CompoundCursor. A CompoundCursor has one output for each output of the associated Source.List that contains the outputs of this CompoundCursor.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||