com.sdm.quasar.client.core.data.plugins.impl
Class DefaultIndexedValuesPlugIn

java.lang.Object
  extended bycom.sdm.quasar.client.core.data.plugin.AbstractDataManagerPlugIn
      extended bycom.sdm.quasar.client.core.data.plugins.impl.DefaultIndexedValuesPlugIn
All Implemented Interfaces:
DataManagerPlugIn, Disposable, IndexedValuesPlugIn

public class DefaultIndexedValuesPlugIn
extends AbstractDataManagerPlugIn
implements IndexedValuesPlugIn

Implementation of the IndexedValuesPlugIn.

This implementation should be registered as the first plug in after com.sdm.quasar.client.core.data.BasicValuesPlugIn since it provides the basic infrastructure.

Version:
1.0
Author:
Thomas Wolf, sd&m AG, Bernd Olleck, sd&m AG, Martin Haft, sd&m AG

Constructor Summary
DefaultIndexedValuesPlugIn()
          Constructor.
 
Method Summary
 void dispose()
          Disposes the component.
 java.lang.Object getIndexForValue(java.lang.String key, java.lang.Object value)
          Returns the index that would return the given value if used as part of a Context in an indexed access.
 void install(DataCore dataCore)
          Called by the data core when the plug in is installed in the data core
protected  void notifyNodeAdded(NodeController node)
          Installs a value handler if the node is either a IndexedNode and its source type is a List.
protected  void notifyNodeWillBeRemoved(NodeController node)
          Called by the DataCore before a node will be removed.
 
Methods inherited from class com.sdm.quasar.client.core.data.plugin.AbstractDataManagerPlugIn
getDataCore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIndexedValuesPlugIn

public DefaultIndexedValuesPlugIn()
Constructor.

Method Detail

install

public void install(DataCore dataCore)
Description copied from interface: DataManagerPlugIn
Called by the data core when the plug in is installed in the data core

Specified by:
install in interface DataManagerPlugIn
Overrides:
install in class AbstractDataManagerPlugIn
See Also:
AbstractDataManagerPlugIn.install(com.sdm.quasar.client.core.data.plugin.DataCore)

notifyNodeAdded

protected void notifyNodeAdded(NodeController node)
Installs a value handler if the node is either a IndexedNode and its source type is a List.

Specified by:
notifyNodeAdded in class AbstractDataManagerPlugIn
Parameters:
node - the node that has been added
See Also:
AbstractDataManagerPlugIn.notifyNodeAdded(NodeController)

notifyNodeWillBeRemoved

protected void notifyNodeWillBeRemoved(NodeController node)
Description copied from class: AbstractDataManagerPlugIn
Called by the DataCore before a node will be removed.

Specified by:
notifyNodeWillBeRemoved in class AbstractDataManagerPlugIn
Parameters:
node - the key of the node that will be removed.

dispose

public void dispose()
             throws DisposeException
Description copied from interface: Disposable
Disposes the component.

Important:
This method is called by an administrating component and must never be called directly.

The implementation should release any resources or objects allocated and any services registered. Furthermore, this method should be developed carefully to free a maximum of resources even when the system may have become unstable. In case of one or multiple errors, you should collect them in a DisposeException, continue with the execution, and throw it at the end of the method.

Note: The implementation must not return before the component is disposed. Any threads or asynchronous calls started must be completed before this method returns.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class AbstractDataManagerPlugIn
Throws:
DisposeException
See Also:
Disposable.dispose()

getIndexForValue

public java.lang.Object getIndexForValue(java.lang.String key,
                                         java.lang.Object value)
Description copied from interface: IndexedValuesPlugIn
Returns the index that would return the given value if used as part of a Context in an indexed access. If the value cannot be found, null will be returned.

If the value exists more than one time on the collection, the first occurrence is returned. Please note that a second call might not return the same index in this case.

Specified by:
getIndexForValue in interface IndexedValuesPlugIn
Parameters:
key - the key of the node that is the indexed value
value - the value to be searched for
Returns:
the index or null if the value could not be found