Package oracle.olapi.data.cursor

Examples of oracle.olapi.data.cursor.CompoundCursor


    prepareAndCommit();
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(querySource);
    SpecifiedCursorManager cursorMngr =
                 dp.createCursorManager(cursorMngrSpec);
    CompoundCursor queryCursor = (CompoundCursor)cursorMngr.createCursor();

    // Use the Cursor in some way, such as to display its values.
    getContext().displayCursor(queryCursor);

    getContext().printAsCrosstab(queryCursor);
View Full Code Here


    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
                   dp.createCursorManagerSpecification(querySource);
    SpecifiedCursorManager cursorMngr =
                   dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor =
                   (CompoundCursor) cursorMngr.createCursor();

    // Get the base ValueCursor.
    ValueCursor specifiedUnitsVals = unitsForSelCursor.getValueCursor();

    // Get the outputs.
    List outputs = unitsForSelCursor.getOutputs();
    ValueCursor chanSelVals = (ValueCursor) outputs.get(0);
    ValueCursor timeSelVals = (ValueCursor) outputs.get(1);
    ValueCursor custSelVals = (ValueCursor) outputs.get(2);

    // You can now get the values from the ValueCursor objects.
    // When you have finished using the Cursor objects, close the
    // SpecifiedCursorManager.
    int i = 1;
    do
    {
      println(i + ": " +
              chanSelVals.getCurrentString() + ", " +
              timeSelVals.getCurrentString() + ", " +
              custSelVals.getCurrentString() + ", " +
              specifiedUnitsVals.getCurrentValue());
      i++;
    }
    while(unitsForSelCursor.next());

    cursorMngr.close();

    // Create an ArrayList of the Source objects for use by other examples.
    ArrayList sourcesFromExample4 = new ArrayList();
View Full Code Here

    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
   
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Determine a starting position and the number of rows to display.
    int start = 7;
    int numRows = 12;
   
    println("Month     Product     Unit Price");
    println("-----     -------     ----------");

    // Iterate through the specified positions of the root CompoundCursor.
    // Assume that the Cursor contains at least (start + numRows) positions.
    for(int pos = start; pos < start + numRows; pos++)
    {
      // Set the position of the root CompoundCursor.
      rootCursor.setPosition(pos);

      // Print the local values of the output and base ValueCursors.
      // The getLocalValue method gets the local value from the unique
      // value of a dimension element.
      String timeValue = ((ValueCursor)rootCursor.getOutputs().get(0))
                          .getCurrentString();
      String timeLocVal = getContext().getLocalValue(timeValue);
      String prodValue = ((ValueCursor)rootCursor.getOutputs().get(1))
                          .getCurrentString();
      String prodLocVal = getContext().getLocalValue(prodValue);
      Object price = rootCursor.getValueCursor().getCurrentValue();
      println("  " + timeLocVal + sp9 + prodLocVal + sp9 +  price);
    }
    cursorMngr.close();

    return unitPriceByMonth;
View Full Code Here

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the outputs and the ValueCursor.
    List outputs = rootCursor.getOutputs();
    // The first output has the values of timeSel, the slower varying output.
    ValueCursor rowCursor = (ValueCursor) outputs.get(0);
    // The second output has the faster varying values of prodSel.
    ValueCursor columnCursor = (ValueCursor) outputs.get(1);
    // The base ValueCursor has the values from unitPrice.
    ValueCursor unitPriceValues = rootCursor.getValueCursor();

    // Display the values as a crosstab.
    println("\t        PRODUCT_AW");
    println("\t-----------------------");
    print("Month");
View Full Code Here

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor = (CompoundCursor) cursorMngr.createCursor();

    // Display the results in a crosstab.
    getContext().printAsCrosstab(unitsForSelCursor);
   
    // For the printAsCrosstab method, see the CursorPrintWriter class.
View Full Code Here

    prodSelValCSpec.setParentStartCalculationSpecified(true);
    prodSelValCSpec.setParentEndCalculationSpecified(true);

    // Create the CursorManager and the Cursor.
    SpecifiedCursorManager cursorMngr = dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the child Cursor objects.
    ValueCursor baseValCursor = rootCursor.getValueCursor();
    List outputs = rootCursor.getOutputs();
    ValueCursor chanSelVals = (ValueCursor) outputs.get(0);
    ValueCursor timeSelVals = (ValueCursor) outputs.get(1);
    ValueCursor custSelVals = (ValueCursor) outputs.get(2);
    ValueCursor prodSelVals = (ValueCursor) outputs.get(3);
   
    // Set the position of the root CompoundCursor.
    rootCursor.setPosition(15);

    // Get the values at the current position and determine the span
    // of the values of the time and product outputs.
    print(chanSelVals.getCurrentValue() + ", ");
    print(timeSelVals.getCurrentValue() + ", ");
View Full Code Here

   */
  private void _printTuple(Cursor cursor, boolean displayLocVal)
  {
    if(cursor instanceof CompoundCursor)
    {
      CompoundCursor compoundCursor = (CompoundCursor)cursor;
      print("(");
      Iterator iterOutputs = compoundCursor.getOutputs().iterator();
      Cursor output = (Cursor)iterOutputs.next();
      _printTuple(output, displayLocVal);
      while(iterOutputs.hasNext())
      {
        print(",");
        _printTuple((Cursor)iterOutputs.next(), displayLocVal);
      }
      print(",");
      _printTuple(compoundCursor.getValueCursor(), displayLocVal);
      print(")");
      _printParentInfo(cursor);
    }
    else if(cursor instanceof ValueCursor)
    {
View Full Code Here

    while (pageIter.hasNext())
    {
      Cursor cursor = (Cursor) pageIter.next();
      if (cursor instanceof CompoundCursor)
      {
        CompoundCursor cc = (CompoundCursor) cursor;
        List outputs = cc.getOutputs();
        ValueCursor output = (ValueCursor) outputs.get(0);
        String value = output.getCurrentString();
        println(value);
      }
      else
View Full Code Here

    do
    {
      print("\t");
      if (colCursor instanceof CompoundCursor)
      {
        CompoundCursor cc = (CompoundCursor) colCursor;
        List outputs = cc.getOutputs();
        ValueCursor output = (ValueCursor) outputs.get(0);
        String value = output.getCurrentString();
        print(value);
      }
      else
View Full Code Here

    do
    {
      // Print row dimension value
      if (rowCursor instanceof CompoundCursor)
      {
        CompoundCursor cc = (CompoundCursor) rowCursor;
        List outputs = cc.getOutputs();
        ValueCursor output = (ValueCursor) outputs.get(0);
        String value = output.getCurrentString();
        print(value);
      }
      else
View Full Code Here

TOP

Related Classes of oracle.olapi.data.cursor.CompoundCursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.