|
Oracle® OLAP Java API Reference 10g Release 2 (10.2) B14348-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for an object that represents a set of assignments that apply to a dimensioned Source
, which is a Source
that has one or more inputs. Each assignment specifies a calculation that supplies a value for the Source
. The assigned value can override an existing value.
A Model
can apply to a Source
derived from one of the following:
Source
for an MdmDimensionedObject
.Source
returned by the createSolvedSource
method of a CustomModel
.When Oracle OLAP applies a Model
to a dimensioned Source
, the assignments of the Model
modify the values of that Source
. For example, an assignment might set the value specified by one member of a dimension to be 110% of the value specified by another member of the dimension. For instance, suppose the Time dimension has a custom member that represents the year 2005. The Model
for the Unit Price measure has an assignment that specifies that the value for 2005 is 1.1 times the value for 2004. When a query joins the Source
for the Time dimension to the Source
for the Unit Price measure, then Oracle OLAP assigns the calculated value as the measure value for 2005 in the Source
that represents the results of the query.
An OLAP API Model
is analogous to the SQL MODEL
clause and an Oracle OLAP DML model object. The assignments of an OLAP API Model
are analogous to the UPDATE RULES
in the SQL MODEL
clause. Like the SQL MODEL
clause, the assignments in an OLAP API Model
only modify values for in the context of a query; they do not change the persistant data itself.
The OLAP API provides the following implementations of the Model
interface.
MdmModel
, instances of which Oracle OLAP creates and applies to Source
objects for MdmMeasure
and MdmAttribute
objects. When an application adds an assignment to an MdmModel
and creates a query that uses the associated measure or attribute, then Oracle OLAP automatically assigns the calculated values to the results of the query. Creating a custom dimension member implicitly adds an assignment to the relevant MdmModel
.CustomModel
, instances of which an application can create by using the createModel
methods of a DataProvider
. The application explicitly adds assignments to the CustomModel
. Those assignments apply to a Source
returned by the createSolvedSource
method of the CustomModel
. An application can use a CustomModel
to implement a custom measure dimension.The assignments of a Model
are represented by Assignment
objects. The assign
methods of a Model
create Assignment
objects and add them to the Model
. An Assignment
has one or more Qualification
objects and an assigned Source
. A Qualification
specifies an element of a Source
that is an input of the Model
. That Source
is the qualified Source
of the Qualification
. The assigned Source
provides the value that the Oracle OLAP assigns for the set of Qualification
objects.
For a diagram of the Model
class hierarchy, see Model Class Hierarchy. For a diagram of the Model
class associations, see Model Class Associations.
The Model
interface has accessor methods for the following operations.
Model
.Assignment
objects.Model
objects.The type of a Model
is the Source
for an OLAP API data type. The type of a Model
must match the type of the Source
to which Oracle OLAP assigns the value specified by the Model
. The data type of the Model
must match the data type of the value that the Model
assigns. For example, if the type of the Model
is Number, then the Model
applies only to NumberSource
objects and the assigned
Source
objects of the Assignment
objects of the Model
must be NumberSource
objects.
An input of a Model
is the Source
object for a dimension or list that has the elements for which the Model
specifies a value. A Model
has an input for each Source
that is the type or is an input of the Source
for the Model
. If the Model
has more than one input, then adding an Assignment
to it requires the use of an assign
method that takes an array of Qualification
objects or of String
values.
An output of a Model
is also a Source
object. For more information on outputs, see
.CustomModel
The getAssignments
method gets the Assignment
objects of a Model
. The getAutoAssignments
method gets the Assignment
objects that Oracle OLAP automatically creates for the Model
. For more information on automatically created Assignment
objects, see
.MdmDimensionCalculationModel
A Model
can inherit the Assignment
objects of a parent Model
. For information on parent Model
objects, see CustomModel
and
.MdmMeasureModel
The precedence values of the Assignment
objects of a Model
affect the order in which Oracle OLAP calculates and assigns their values. Oracle OLAP evaluates an Assignment
with a higher precedence value before an Assignment
with a lower value.
Model
objects require the use of unique dimension hierarchy member values. For more information on unique and local dimension hierarchy values, see the Overview and
.ExpressDataProvider
MdmMeasure
, MdmStandardMember
Method Summary | |
void |
assign(Qualification[] qualifications, Source assigned) Creates an Assignment with the default precedence and adds it to the Model . |
void |
assign(Qualification[] qualifications, Source assigned, int precedence) Creates an Assignment with the specified precedence and adds it to the Model . |
void |
assign(java.lang.String[] values, Source assigned) Creates an Assignment with the default precedence and adds it to the Model . |
void |
assign(java.lang.String[] values, Source assigned, int precedence) Creates an Assignment with the specified precedence and adds it to the Model . |
void |
assign(java.lang.String value, Source assigned) Creates an Assignment with the default precedence and adds it to the Model ; use this method for a Model that has only one input. |
void |
assign(java.lang.String value, Source assigned, int precedence) Creates an Assignment with the specified precedence and adds it to the Model ; use this method for a Model that has only one input. |
Source |
createSolvedSource() Creates a Source that represents the results of the evaluation of the Assignment objects of the Model ; elements of the returned Source that do not have an assigned value have a value of null . |
Source |
createSolvedSource(Source defaultValues) Creates a Source that represents the results of the evaluation of the Assignment objects of the Model ; elements of the returned Source that do not have an assigned value have the value specified by the defaultValues Source . |
java.util.List |
getAssignments() Gets the Assignment objects of the Model . |
java.util.List |
getAutoAssignments() Gets the Assignment objects that Oracle OLAP automatically creates for the Model . |
int |
getDefaultPrecedence() Gets the default precedence value for the Model . |
java.util.List |
getInputs() Gets the Source objects that are the inputs of the Model . |
java.util.List |
getOutputs() Gets the Source objects that are the outputs of the Model . |
java.util.List |
getParentModels() Gets the Model objects that are the parents of the Model . |
Source |
getType() Gets the Source for the FundamentalMetadataObject that represents the data type of the Model . |
void |
setDefaultPrecedence(int precedence) Specifies the default precedence, which is the precedence value for Assignment objects that are created by methods that do not specify a precedence value. |
void |
unassign(Assignment assignment) Removes an Assignment from the Model . |
Method Detail |
public Source getType()
Source
for the FundamentalMetadataObject
that represents the data type of the Model
.Source
that is the type of the Model
.public java.util.List getInputs()
Source
objects that are the inputs of the Model
.List
of the Source
objects that are the inputs of the Model
.public java.util.List getOutputs()
Source
objects that are the outputs of the Model
. A CustomModel
can have outputs. An MdmModel
does not have outputs.List
of the Source
objects that are the outputs of the Model
.public java.util.List getParentModels()
Model
objects that are the parents of the Model
. A Model
can inherit the Assignment
objects of a parent if the type, the inputs, and any outputs of the Model
are the same as those of the parent Model
.List
of the Model
objects that are the parent models of the Model
.public java.util.List getAssignments()
Assignment
objects of the Model
.List
of the Assignment
objects of the Model
.public java.util.List getAutoAssignments()
Assignment
objects that Oracle OLAP automatically creates for the Model
.List
of the Assignment
objects created automatically for the Model
.MdmDimensionCalculationModel
public void assign(Qualification[] qualifications, Source assigned)
Assignment
with the default precedence and adds it to the Model
.qualifications
- An array of Qualification
objects, each of which specifies an element of an input Source
. The array can include a Qualification
for each input of the Model
.assigned
- A Source
that specifies the value to assign.public void assign(Qualification[] qualifications, Source assigned, int precedence)
Assignment
with the specified precedence and adds it to the Model
.qualifications
- An array of Qualification
objects, each of which specifies an element of an input Source
. The array can include a Qualification
for each input of the Model
.assigned
- A Source
that specifies the value to assign.precedence
- An integer that specifies a precedence value for the Assignment
.public void assign(java.lang.String value, Source assigned)
Assignment
with the default precedence and adds it to the Model
; use this method for a Model
that has only one input.value
- A String
that specifies an element of the input Source
.assigned
- A Source
that specifies the value to assign.public void assign(java.lang.String value, Source assigned, int precedence)
Assignment
with the specified precedence and adds it to the Model
; use this method for a Model
that has only one input.value
- A String
that specifies an element of the input Source
.assigned
- A Source
that specifies the value to assign.precedence
- An integer that specifies a precedence value for the Assignment
.public void assign(java.lang.String[] values, Source assigned)
Assignment
with the default precedence and adds it to the Model
.values
- An array of String
objects each of which specifies an element of an input Source
. The array can include a element for each input of the Model
.assigned
- A Source
that specifies the value to assign.public void assign(java.lang.String[] values, Source assigned, int precedence)
Assignment
with the specified precedence and adds it to the Model
.values
- An array of String
objects each of which specifies an element of an input Source
. The array can include a element for each input of the Model
.assigned
- A Source
that specifies the value to assign.precedence
- An integer that specifies a precedence value for the Assignment
.public void unassign(Assignment assignment)
Assignment
from the Model
.assignment
- The Assignment
to remove.public int getDefaultPrecedence()
Model
.Assignment
objects that are created by methods that do not specify a precedence value.public void setDefaultPrecedence(int precedence)
Assignment
objects that are created by methods that do not specify a precedence value.precedence
- An integer value to set as the default precedence.public Source createSolvedSource()
Source
that represents the results of the evaluation of the Assignment
objects of the Model
; elements of the returned Source
that do not have an assigned value have a value of null
. The Source
has as inputs the Source
objects that are the inputs of the Model
associated with it.Source
that represents the results of the evaluation of the Assignment
objects of the Model
and that has null
for unassigned values.public Source createSolvedSource(Source defaultValues)
Source
that represents the results of the evaluation of the Assignment
objects of the Model
; elements of the returned Source
that do not have an assigned value have the value specified by the defaultValues
Source
. The Source
has as inputs the Source
objects that are the inputs of the Model
associated with it.defaultValues
- A Source
that specifies the value to assign for a member of an input when the Assignment
objects of the Model
do not assign a value for the input member.Source
that represents the results of the evaluation of the Assignment
objects of the Model
and that has the value of defaultValues
for unassigned values.
|
Oracle® OLAP Java API Reference 10g Release 2 (10.2) B14348-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |