Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

oracle.olapi.data.cursor
Interface CompoundCursor


public abstract interface CompoundCursor
extends Cursor

A Cursor for a Source that has outputs. A CompoundCursor has a child base ValueCursor, the elements of which have the values of the Source. A CompoundCursor also has one or more outputs, one for each output of its 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 in which the outputs of the Source were specified. 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 prodRollup and calRollup are StringSource objects for the default MdmLevelHierarchy objects for the products and times dimensions, which are the dimensions of the measure. productsSel

 Source productsSel =
        prodRollup.selectValues(new String[] {"PROD_ROLLUP::PRODUCT::1701",
                                              "PROD_ROLLUP::PRODUCT::1815",
                                              "PROD_ROLLUP::PRODUCT::1936",
                                              "PROD_ROLLUP::PRODUCT::2054"};
 Source timesSel =
        calRollup.selectValues(new String[] {"CAL_ROLLUP::DAY::14-JUN-99",
                                             "CAL_ROLLUP::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 its element values, and it has productsSel and timesSel as its outputs. The following code prepares and commits the current Transaction, and then creates a CursorManagerSpecification, a CursorManager, and finally a Cursor for productsPriceForDay. The dp object is the DataProvider.

 CursorManagerSpecification cmSpec =
                   dp.createCursorManagerSpecification(productsPriceForDay);
 SpecifiedCursorManager cursorManager = dp.createCursorManager(cmSpec);
 Cursor result = cursorManager.createCursor();

Because the productsPriceForDay has outputs, result is a CompoundCursor. Its 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 its 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.


Fields inherited from class 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

getValueCursor

public ValueCursor getValueCursor()
Gets the base ValueCursor of the CompoundCursor. The base ValueCursor has the values of the Source for the CompoundCursor.
Returns:
The base ValueCursor of the CompoundCursor.

getOutputs

public java.util.List getOutputs()
Gets the outputs of the CompoundCursor. An output is a ValueCursor or a CompoundCursor. A CompoundCursor has one output for each output of its Source.
Returns:
A List whose elements are the outputs of this CompoundCursor.

Oracle OLAP Java API Reference
10g Release 1 (10.1)

B10994-01

Copyright © 2002, 2003, Oracle. All Rights Reserved.