Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.olap
Class OlapDataModel

java.lang.Object
  extended by com.citra.pivot.AbstractPivotDataModel
      extended by com.citra.pivot.olap.OlapDataModel
All Implemented Interfaces:
OlapProviderListener, PivotDataModel, EventListener

public class OlapDataModel
extends AbstractPivotDataModel
implements OlapProviderListener

OlapDataModel is the default olap data model to use for connecting to olap datasources. The model's row and column headers are returned by the olap provider in use.


Field Summary
protected  OlapColumnAdapter olapColumnAdapter
          the model's column header
protected  OlapProvider olapProvider
          the assoicated olap provider
protected  OlapRowAdapter olapRowAdapter
          the model's row header
 
Fields inherited from class com.citra.pivot.AbstractPivotDataModel
dataListeners
 
Constructor Summary
OlapDataModel(OlapProvider provider)
          Constructs an OlapDataModel.
 
Method Summary
 Class getColumnClass(TreePath[] rowPaths, TreePath[] columnPaths)
          Determines the class of the model's cell at the specified row and column paths.
 OlapProvider getOlapProvider()
          Retrieves the olap provider on which the data model depends.
 PivotColumnAdapter getPivotColumnAdapter()
          Retrieves the model's pivot column header.
 PivotRowAdapter getPivotRowAdapter()
          Retrieves the model's pivot row header.
 Object getValueAt(TreePath[] rowPaths, TreePath[] columnPaths)
          Retrieves the value of the data at the specfied row and column paths.
 boolean isValueCached(TreePath[] rowPaths, TreePath[] columnPaths)
          Determines whether a value has been retrieved from the underlying datasource.
 void pivotEdgesChanged(ChangeEvent e)
          Notification that the edges (row and/or column header) of an olap provider have changed.
 void pivotFiltersChanged(ChangeEvent e)
          Notification that the filter area of an olap provider has changed.
 void setEdges(OlapRowAdapter rowAdapter, OlapColumnAdapter columnAdapter)
          Assigns the row and column headers to use as the edges of the pivot table.
 void setOlapProvider(OlapProvider provider)
          Assigns a new olap provider.
 void setPivotColumnAdapter(OlapColumnAdapter adapter)
          Assigns the column header to use.
 void setPivotRowAdapter(OlapRowAdapter adapter)
          Assigns the row header to use.
 
Methods inherited from class com.citra.pivot.AbstractPivotDataModel
addDataModelListener, fireDataChanged, fireEdgesChanged, removeDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

olapRowAdapter

protected OlapRowAdapter olapRowAdapter
the model's row header


olapColumnAdapter

protected OlapColumnAdapter olapColumnAdapter
the model's column header


olapProvider

protected OlapProvider olapProvider
the assoicated olap provider

Constructor Detail

OlapDataModel

public OlapDataModel(OlapProvider provider)
Constructs an OlapDataModel.

Method Detail

getColumnClass

public Class getColumnClass(TreePath[] rowPaths,
                            TreePath[] columnPaths)
Determines the class of the model's cell at the specified row and column paths.

Specified by:
getColumnClass in interface PivotDataModel
Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the class for the specified cell

getOlapProvider

public OlapProvider getOlapProvider()
Retrieves the olap provider on which the data model depends.

Returns:
the olap provider

getPivotColumnAdapter

public PivotColumnAdapter getPivotColumnAdapter()
Retrieves the model's pivot column header.

Specified by:
getPivotColumnAdapter in interface PivotDataModel
Returns:
the column header

getPivotRowAdapter

public PivotRowAdapter getPivotRowAdapter()
Retrieves the model's pivot row header.

Specified by:
getPivotRowAdapter in interface PivotDataModel
Returns:
the row header

getValueAt

public Object getValueAt(TreePath[] rowPaths,
                         TreePath[] columnPaths)
Retrieves the value of the data at the specfied row and column paths.

Specified by:
getValueAt in interface PivotDataModel
Parameters:
rowPaths - the cell's row header paths
columnPaths - the cell's column header paths
Returns:
the value for the specified cell

isValueCached

public boolean isValueCached(TreePath[] rowPaths,
                             TreePath[] columnPaths)
Determines whether a value has been retrieved from the underlying datasource.

Parameters:
rowPaths - the paths of the row header
columnPaths - the paths of the column header
Returns:
true, if the value has been cached, false otherwise

pivotEdgesChanged

public void pivotEdgesChanged(ChangeEvent e)
Notification that the edges (row and/or column header) of an olap provider have changed.

Specified by:
pivotEdgesChanged in interface OlapProviderListener
Parameters:
e - the event that triggers the notification

pivotFiltersChanged

public void pivotFiltersChanged(ChangeEvent e)
Notification that the filter area of an olap provider has changed.

Specified by:
pivotFiltersChanged in interface OlapProviderListener
Parameters:
e - the event that triggers the notification

setEdges

public void setEdges(OlapRowAdapter rowAdapter,
                     OlapColumnAdapter columnAdapter)
Assigns the row and column headers to use as the edges of the pivot table.

Parameters:
rowAdapter - the row header to assign
columnAdapter - the column header to assign

setOlapProvider

public void setOlapProvider(OlapProvider provider)
Assigns a new olap provider.

Parameters:
provider - the provider to assign

setPivotColumnAdapter

public void setPivotColumnAdapter(OlapColumnAdapter adapter)
Assigns the column header to use.

Parameters:
adapter - the column header to assign

setPivotRowAdapter

public void setPivotRowAdapter(OlapRowAdapter adapter)
Assigns the row header to use.

Parameters:
adapter - the row header to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.