|
Oracle® OLAP Java API Reference 12c Release 1 (12.1) E17708-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
oracle.olapi.data.source.Parameter
oracle.olapi.data.source.NumberParameter
public class 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.
The createSource method creates a parameterized NumberSource. You 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 then 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 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. 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 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 = (NumberSource) numParam.createSource();
NumberSource qualifiedUnits =
(NumberSource) units.join(timeHier, "CALENDAR_YEAR::YEAR::CY2001")
.join(custHier, "SHIPMENTS::REGION::EMEA")
.join(chanHier,"CHANNEL_PRIMARY::CHANNEL::INT");
Source paramProdSel = prodHier.select(qualifiedUnits.gt(numParamSrc));
Source results = prodShortDescr.join(paramProdSel);
dp.getTransactionProvider().commitCurrentTransaction();
CursorManager cursorManager = dp.createCursorManager(results);
Cursor resultsCursor = cursorManager.createCursor();
The following table displays the values of resultsCursor and adds column heading.
Product Short Description ------------------------------------ ----------------- PRODUCT_PRIMARY::TOTAL_PRODUCT::TOTAL Total Product PRODUCT_PRIMARY::CLASS::HRD Hardware PRODUCT_PRIMARY::FAMILY::DISK CD/DVD PRODUCT_PRIMARY::FAMILY::MOD Modems/Fax PRODUCT_PRIMARY::CLASS::SFT Software/Other PRODUCT_PRIMARY::FAMILY::ACC Accessories PRODUCT_PRIMARY::FAMILY::OS Operating Systems
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 headings.
Product Short Description ------------------------------------ ----------------- PRODUCT_PRIMARY::TOTAL_PRODUCT::TOTAL Total Product PRODUCT_PRIMARY::CLASS::HRD Hardware PRODUCT_PRIMARY::CLASS::SFT Software/Other PRODUCT_PRIMARY::FAMILY::ACC 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 |
|---|
createSource, 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.acceptVisitor in class Parametervisitor - 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.getValueObject in class ParameterNumberParameter 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.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||