com.tonbeller.jpivot.core
Class ModelSupport

java.lang.Object
  extended by com.tonbeller.jpivot.core.ModelSupport
All Implemented Interfaces:
Model, com.tonbeller.wcf.bookmarks.Bookmarkable
Direct Known Subclasses:
Empty.EmptyModel, MdxOlapModel, ScalarOlapModel, TestOlapModel

public class ModelSupport
extends java.lang.Object
implements Model

Default implementation of a model

Author:
av

Field Summary
 
Fields inherited from interface com.tonbeller.wcf.bookmarks.Bookmarkable
EXTENSIONAL, INTENSIONAL
 
Constructor Summary
ModelSupport()
           
 
Method Summary
 void addExtension(Extension extension)
          adds a Feature to this model.
 void addModelChangeListener(ModelChangeListener l)
          adds a model change listener
 void destroy()
          clears all references to extensioins (to avoid memory leaks)
 void fireModelChanged()
           
 void fireModelChanged(ModelChangeEvent e)
           
 void fireStructureChanged()
           
 void fireStructureChanged(ModelChangeEvent e)
           
 java.lang.Object getBookmarkState(int levelOfDetail)
          returns null
 Extension getExtension(java.lang.String id)
          returns the extension if this model instance supports it.
 java.util.Map getExtensions()
          returns the extensions
 java.util.Locale getLocale()
          Returns the current locale.
 Model getRootModel()
          Returns the bottom element of the decorator chain.
 Model getTopDecorator()
          Returns a decorated model if any of the extensions decorate this.
 void removeModelChangeListener(ModelChangeListener l)
          removes a model change listener
 void setBookmarkState(java.lang.Object state)
          does nothing
 void setLocale(java.util.Locale locale)
          Sets the current locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelSupport

public ModelSupport()
Method Detail

destroy

public void destroy()
clears all references to extensioins (to avoid memory leaks)


getExtension

public Extension getExtension(java.lang.String id)
Description copied from interface: Model
returns the extension if this model instance supports it. Returns null if the extension is not supported.

Specified by:
getExtension in interface Model
See Also:
com.tonbeller.jpivot.model.Model#getFeature(String)

getExtensions

public java.util.Map getExtensions()
returns the extensions

Specified by:
getExtensions in interface Model
See Also:
Extension

addExtension

public void addExtension(Extension extension)
adds a Feature to this model. Used by ModelFactory.

Specified by:
addExtension in interface Model

getBookmarkState

public java.lang.Object getBookmarkState(int levelOfDetail)
returns null

Specified by:
getBookmarkState in interface com.tonbeller.wcf.bookmarks.Bookmarkable

setBookmarkState

public void setBookmarkState(java.lang.Object state)
does nothing

Specified by:
setBookmarkState in interface com.tonbeller.wcf.bookmarks.Bookmarkable

addModelChangeListener

public void addModelChangeListener(ModelChangeListener l)
Description copied from interface: Model
adds a model change listener

Specified by:
addModelChangeListener in interface Model
See Also:
Model.addModelChangeListener(ModelChangeListener)

removeModelChangeListener

public void removeModelChangeListener(ModelChangeListener l)
Description copied from interface: Model
removes a model change listener

Specified by:
removeModelChangeListener in interface Model
See Also:
Model.removeModelChangeListener(ModelChangeListener)

fireModelChanged

public void fireModelChanged()

fireModelChanged

public void fireModelChanged(ModelChangeEvent e)

fireStructureChanged

public void fireStructureChanged()

fireStructureChanged

public void fireStructureChanged(ModelChangeEvent e)

getLocale

public java.util.Locale getLocale()
Returns the current locale.

Returns:
Locale

setLocale

public void setLocale(java.util.Locale locale)
Sets the current locale.

Specified by:
setLocale in interface Model
Parameters:
locale - The locale to set

getTopDecorator

public Model getTopDecorator()
Returns a decorated model if any of the extensions decorate this. Returns this otherwise.

Specified by:
getTopDecorator in interface Model

getRootModel

public Model getRootModel()
Description copied from interface: Model
Returns the bottom element of the decorator chain. The returned model does not decorate any other model, its the end of the chain.

Specified by:
getRootModel in interface Model