|
Components |
|
| |||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
Axis | This implementation is designed for the simple definition of axes in a multidimensional ResultSet. |
OLAPDataSet | The OLAPDataSet together with the ResultSetInterface, ResultSetMetadataInterface, AxisInterface, TupleInterface, TupleElementInterface, and PerformanceTuningInterface make up the Data portion of the MD model. |
ResultSet | Used for building an in memory multidimensional ResultSet. |
ResultSetMetadata | Used for building embedded multidimensional ResultSetMetadata, which defines the structure and contents of the resultset. |
Tuple | Used for building the Tuples of an in memory multidimensional ResultSet This implementation is designed for the simple definition of a tuple in a multidimensional ResultSet. |
TupleElement | This implementation is designed for the simple definition of tuple elements in a multidimensional ResultSet. |
Provides a set of classes for building an in memory multidimensional Result Set.
OVERVIEW
This package provides a set of classes which can be used to build an in memory Result Set. This implementation provides a MutableResultSet model for a simple definition of multidimensional data. The data is stored in memory within the model. There is no connection or query associated with this model. To use the MutableResultSet model, simply start defining tuples and cells and adding axes with the appropriate data.
EXAMPLES
Creating an in memory Olap model
try {
//The following example creates a model with Sales For all Dealers of Ford and Chrysler for the months of
// January through May.
// Make an instance of the Tuple Interface object
TupleInterface tuple1 = new Tuple(new TupleElementInterface[]
{new TupleElement("All Dealer"), new TupleElement("January")});
TupleInterface tuple2 = new Tuple(new TupleElementInterface[]
{new TupleElement("All Dealer"), new TupleElement("February")});
TupleInterface tuple3 = new Tuple(new TupleElementInterface[]
{new TupleElement("All Dealer"), new TupleElement("March")});
TupleInterface tuple4 = new Tuple(new TupleElementInterface[]
{new TupleElement("All Dealer"), new TupleElement("April")});
TupleInterface tuple5 = new Tuple(new TupleElementInterface[]
{new TupleElement("All Dealer"), new TupleElement("May")});
TupleInterface tuple6 = new Tuple(new TupleElementInterface[]
{new TupleElement("Chrysler")});
TupleInterface tuple7 = new Tuple(new TupleElementInterface[]
{new TupleElement("Ford")});
TupleInterface tuple8 = new Tuple(new TupleElementInterface[]
{new TupleElement("Sum of Sales")});
// Define the Axis for the model
String[] colHeaders = new String[] {"All:Dealers", "Date"} ;
String[] rowHeaders = new String[]{"Cars"};
String[] slicerHeaders = new String[]{"Sum of Sales"};
AxisInterface columnAxis = new Axis(AxisInterface.COLUMSNAXIS, colHeaders,
new TupleInterface[] {tuple1, tuple2, tuple3, tuple4, tuple5});
AxisInterface rowAxis = new Axis(AxisInterface.ROWSAXIS, rowHeaders,
new TupleInterface[] {tuple6, tuple7});
AxisInterface slicerAxis = new Axis(AxisInterface.SLICERSAXIS, slicerHeaders,
new TupleInterface[] {tuple8});
AxisInterface[] axes = {columnAxis, rowAxis, slicerAxis};
//create an instance of result set metadata with the axes
ResultSetMetadata rsma = new ResultSetMetadata(axes);
// create cell values
Object[] cells = new Object[] {new Double(20000.0), new Double(47000.0),
new Double(52000.0), new Double(20000.0),
new Double(24000.00), new Double(10000.0),
new Double(40000.0), new Double(2000.0),
new Double(30000.0), new Double(36000.0)};
ResultSet rs = new ResultSet();
rs.setResultSetMetadata(rsma);
rs.setCells(0, OLAPDataSet.DEFAULT_ENDCELL, cells);
// create an olap model (that attaches to the viewer) using the result set
OLAPDataSet OLAPDataSet = new OLAPDataSet(rs);}
catch (OLAPException ex) {
System.out.println(ex.getMessage());
ex.printStackTrace();
}
For More Information
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
|
Components |
|
| |||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |