|
Oracle OLAP Java API Reference 10g Release 1 (10.1) B10994-01 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--oracle.olapi.data.source.Parameter
|
+--oracle.olapi.data.source.NumberParameter
A Parameter that specifies a number value that you use in creating a query. After creating the query, you can change the value of the NumberParameter and thereby change the selection of dimension or measure elements that the query represents.
You use a NumberParameter to create a parameterized NumberSource with the createParameterizedSource(NumberParameter param) method of the DataProvider you used to create the NumberParameter. You then use the parameterized NumberSource as a parameter to a method that selects one or more elements of another Source and produces a derived Source. You can commit the Transaction and create a Cursor for the Source to retrieve the results of the query.
You can change the selection of elements that the derived Source represents by changing the value of the NumberParameter with the appropriate setValue method. The Cursor for the query Source then has the values of the new selection. You do not need to commit the Transaction nor create a new Cursor. You can instead just set the position of the existing Cursor to its first position and get the values for the new selection from the Cursor.
The following example creates a NumberParameter with the value 1000 and uses it to create a parameterized NumberSource. The dp object is the DataProvider and tp is the TransactionProvider. The example joins Source objects for a measure of product units sold, and for single selections from the default hierarchies of three of the four dimensions of the measure. The example then produces a selection of product values, paramProdSel, for which the number of units sold is greater than the value of the NumberParameter. It joins the paramProdSel to the Source for the short description attribute for the product dimension, which produces the results Source. Finally, the example creates a Cursor for results.
NumberParameter numParam = new NumberParameter(dp, 1000);
NumberSource numParamSrc = dp.createParameterizedSource(numParam);
NumberSource qualifiedUnits =
(NumberSource) units.join(timeHier, "CALENDAR::YEAR::4")
.join(custHier, "SHIPMENTS_ROLLUP::REGION::9")
.join(chanHier,"CHANNEL_ROLLUP::CHANNEL::4");
Source paramProdSel = prodHier.select(qualifiedUnits.gt(numParamSrc));
Source results = prodShortDescr.join(paramProdSel);
// try, catch block omitted for brevity
tp.prepareCurrentTransaction();
tp.commitCurrentTransaction();
CursorManagerSpecification cMngrSpec =
dp.createCursorManagerSpecification(results);
SpecifiedCursorManager spCMngr = dp.createCursorManager(cMngrSpec);
Cursor resultsCursor = spCMngr.createCursor();
The following table displays the values of resultsCursor and adds column heading.
Product Short Description -------------------------------- ----------------- PRODUCT_ROLLUP::TOTAL_PRODUCT::1 Total Product PRODUCT_ROLLUP::CLASS::2 Hardware PRODUCT_ROLLUP::FAMILY::9 Modems/Fax PRODUCT_ROLLUP::FAMILY::11 CD-ROM PRODUCT_ROLLUP::CLASS::3 Software/Other PRODUCT_ROLLUP::FAMILY::6 Operating Systems PRODUCT_ROLLUP::FAMILY::7 Accessories
The following continuation of the example sets the value of the NumberParameter to 1500. It then sets the position of resultsCursor back to the first position of the Cursor.
numParam.setValue(1500); // Reset the Cursor position to 1 resultsCursor.setPosition(1);
The following table displays the values that resultsCursor now contains and adds column heading.
Product Short Description -------------------------------- ----------------- PRODUCT_ROLLUP::TOTAL_PRODUCT::1 Total Product PRODUCT_ROLLUP::CLASS::2 Hardware PRODUCT_ROLLUP::CLASS::3 Software/Other PRODUCT_ROLLUP::FAMILY::7 Accessories
| Constructor Summary | |
NumberParameter(DataProvider dataProvider, double initialValue)Creates a NumberParameter that has the specified double value. | |
NumberParameter(DataProvider dataProvider, java.lang.Double initialValue)Creates a NumberParameter that has the specified Double value. | |
NumberParameter(DataProvider dataProvider, float initialValue)Creates a NumberParameter that has the specified float value. | |
NumberParameter(DataProvider dataProvider, java.lang.Float initialValue)Creates a NumberParameter that has the specified Float value. | |
NumberParameter(DataProvider dataProvider, int initialValue)Creates a NumberParameter that has the specified integer value. | |
NumberParameter(DataProvider dataProvider, java.lang.Integer initialValue)Creates a NumberParameter that has the specified Integer value. | |
NumberParameter(DataProvider dataProvider, long initialValue)Creates a NumberParameter that has the specified long value. | |
NumberParameter(DataProvider dataProvider, java.lang.Long initialValue)Creates a NumberParameter that has the specified Long value. | |
NumberParameter(DataProvider dataProvider, short initialValue)Creates a NumberParameter that has the specified short value. | |
NumberParameter(DataProvider dataProvider, java.lang.Short initialValue)Creates a NumberParameter that has the specified Short value. | |
| Method Summary | |
java.lang.Object |
acceptVisitor(ParameterVisitor visitor, java.lang.Object context)Calls the visitNumberParameter method of the specified ParameterVisitor and passes that method this NumberParameter and the specified context Object. |
double |
getDoubleValue()Gets the value of this NumberParameter as a double. |
float |
getFloatValue()Gets the value of this NumberParameter as a float. |
int |
getIntValue()Gets the value of this NumberParameter as an integer. |
long |
getLongValue()Gets the value of this NumberParameter as a long. |
short |
getShortValue()Gets the value of this NumberParameter as a short. |
java.lang.Number |
getValue()Gets the value of this NumberParameter as an OLAP API Number. |
java.lang.Object |
getValueObject()Gets the value of this NumberParameter as an Object. |
void |
setValue(double value)Sets the value of this NumberParameter to the specified double. |
void |
setValue(java.lang.Double value)Sets the value of this NumberParameter to the specified Double. |
void |
setValue(float value)Sets the value of this NumberParameter to the specified float. |
void |
setValue(java.lang.Float value)Sets the value of this NumberParameter to the specified Float. |
void |
setValue(int value)Sets the value of this NumberParameter to the specified integer. |
void |
setValue(java.lang.Integer value)Sets the value of this NumberParameter to the specified Integer. |
void |
setValue(long value)Sets the value of this NumberParameter to the specified long. |
void |
setValue(java.lang.Long value)Sets the value of this NumberParameter to the specified Long. |
void |
setValue(short value)Sets the value of this NumberParameter to the specified short. |
void |
setValue(java.lang.Short value)Sets the value of this NumberParameter to the specified Short. |
| Methods inherited from class oracle.olapi.data.source.Parameter |
getDataProvider, getID |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NumberParameter(DataProvider dataProvider,
java.lang.Short initialValue)
NumberParameter that has the specified Short value.dataProvider - The DataProvider that you are using.initialValue - The Short that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
short initialValue)
NumberParameter that has the specified short value.dataProvider - The DataProvider that you are using.initialValue - The short that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
java.lang.Integer initialValue)
NumberParameter that has the specified Integer value.dataProvider - The DataProvider that you are using.initialValue - The Integer that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
int initialValue)
NumberParameter that has the specified integer value.dataProvider - The DataProvider that you are using.initialValue - The int that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
java.lang.Long initialValue)
NumberParameter that has the specified Long value.dataProvider - The DataProvider that you are using.initialValue - The Long that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
long initialValue)
NumberParameter that has the specified long value.dataProvider - The DataProvider that you are using.initialValue - The long that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
java.lang.Float initialValue)
NumberParameter that has the specified Float value.dataProvider - The DataProvider that you are using.initialValue - The Float that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
float initialValue)
NumberParameter that has the specified float value.dataProvider - The DataProvider that you are using.initialValue - The float that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
java.lang.Double initialValue)
NumberParameter that has the specified Double value.dataProvider - The DataProvider that you are using.initialValue - The Double that you want this NumberParameter to have.
public NumberParameter(DataProvider dataProvider,
double initialValue)
NumberParameter that has the specified double value.dataProvider - The DataProvider that you are using.initialValue - The double that you want this NumberParameter to have.| Method Detail |
public final java.lang.Object acceptVisitor(ParameterVisitor visitor,
java.lang.Object context)
visitNumberParameter method of the specified ParameterVisitor and passes that method this NumberParameter and the specified context Object.visitor - An instance a class derived from the ParameterVisitor class.context - An Object.Object returned by the visitNumberParameter method of the specified ParameterVisitor.public final short getShortValue()
NumberParameter as a short.NumberParameter as a short.public final int getIntValue()
NumberParameter as an integer.NumberParameter as a int.public final long getLongValue()
NumberParameter as a long.NumberParameter as a long.public final float getFloatValue()
NumberParameter as a float.NumberParameter as a float.public final double getDoubleValue()
NumberParameter as a double.NumberParameter as a double.public final java.lang.Number getValue()
NumberParameter as an OLAP API Number.NumberParameter as an OLAP API Number.public final java.lang.Object getValueObject()
NumberParameter as an Object.NumberParameter as an Object.public final void setValue(java.lang.Short value)
NumberParameter to the specified Short.value - The Short that you want this NumberParameter to have.public final void setValue(short value)
NumberParameter to the specified short.value - The short that you want this NumberParameter to have.public final void setValue(java.lang.Integer value)
NumberParameter to the specified Integer.value - The Integer that you want this NumberParameter to have.public final void setValue(int value)
NumberParameter to the specified integer.value - The int that you want this NumberParameter to have.public final void setValue(java.lang.Long value)
NumberParameter to the specified Long.value - The Long that you want this NumberParameter to have.public final void setValue(long value)
NumberParameter to the specified long.value - The long that you want this NumberParameter to have.public final void setValue(java.lang.Float value)
NumberParameter to the specified Float.value - The Float that you want this NumberParameter to have.public final void setValue(float value)
NumberParameter to the specified float.value - The float that you want this NumberParameter to have.public final void setValue(java.lang.Double value)
NumberParameter to the specified Double.value - The Double that you want this NumberParameter to have.public final void setValue(double value)
NumberParameter to the specified double.value - The double that you want this NumberParameter to have.
|
Oracle OLAP Java API Reference 10g Release 1 (10.1) B10994-01 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||