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

java.lang.Object
  extended bycom.sdm.quasar.client.core.data.plugins.impl.AbstractIndexedValueHandler
      extended bycom.sdm.quasar.client.core.data.plugins.impl.IndexedListValueHandler
All Implemented Interfaces:
ValueHandler

public class IndexedListValueHandler
extends AbstractIndexedValueHandler

Default implementation for a value handler that takes responsibility for storing and accessing a value defined by IndexedNode that is based on a List.

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

Constructor Summary
IndexedListValueHandler()
          Creates a new IndexedListValueHandler.
 
Method Summary
 boolean canHandle(Node node)
          Tests whether the value handler can handle nodes of the given type.
protected  java.lang.Object getIndexedValue(java.lang.Object sourceValue, java.lang.Object indexValue)
          Template method to retrieve to value of the given index from the given source value.
protected  java.util.Set getIndexSet(java.lang.Object sourceValue)
          Template method to retrieve the set of index values for the given source value.
protected  void setIndexedValue(java.lang.Object sourceValue, java.lang.Object indexValue, NodeController node, java.lang.Object value)
          Template method to set a value for the given index at the given source value.
 
Methods inherited from class com.sdm.quasar.client.core.data.plugins.impl.AbstractIndexedValueHandler
canModifyValue, getIndexSet, getValue, hasValue, notifyChildValueChanged, notifyNodeValueChanged, notifySourceValueChanged, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexedListValueHandler

public IndexedListValueHandler()
Creates a new IndexedListValueHandler.

Method Detail

canHandle

public boolean canHandle(Node node)
Description copied from interface: ValueHandler
Tests whether the value handler can handle nodes of the given type.

Parameters:
node - the node definition
Returns:
true iff the value handler can handle that node
See Also:
com.sdm.quasar.client.core.data.internal.impl.ValueHandler#canHandle(com.sdm.quasar.client.core.data.structure.Node)

getIndexedValue

protected java.lang.Object getIndexedValue(java.lang.Object sourceValue,
                                           java.lang.Object indexValue)
Description copied from class: AbstractIndexedValueHandler
Template method to retrieve to value of the given index from the given source value. E.g. for a list the source value is the list and the index value is the Integer of index of the requested value. For am map the value is the map and the index value is the key of the requested value.

Specified by:
getIndexedValue in class AbstractIndexedValueHandler
Parameters:
sourceValue - the source value of the node
indexValue - the index of the requested value
Returns:
value of the given index from the given source value
See Also:
com.sdm.quasar.client.core.data.plugin.impl.AbstractIndexedValueHandler#getIndexedValue(java.lang.Object, java.lang.Object)

setIndexedValue

protected void setIndexedValue(java.lang.Object sourceValue,
                               java.lang.Object indexValue,
                               NodeController node,
                               java.lang.Object value)
Description copied from class: AbstractIndexedValueHandler
Template method to set a value for the given index at the given source value. E.g. for a list the source value is the list and the index value is the Integer of index of the requested value. For am map the value is the map and the index value is the key of the requested value.

Specified by:
setIndexedValue in class AbstractIndexedValueHandler
Parameters:
sourceValue - the source value of the node
indexValue - the index of the requested value
node - the node controlle of the node
value - of the given index from the given source value
See Also:
com.sdm.quasar.client.core.data.plugin.impl.AbstractIndexedValueHandler#setIndexedValue(java.lang.Object, java.lang.Object, com.sdm.quasar.client.core.data.internal.impl.NodeController, java.lang.Object)

getIndexSet

protected java.util.Set getIndexSet(java.lang.Object sourceValue)
Description copied from class: AbstractIndexedValueHandler
Template method to retrieve the set of index values for the given source value.

Specified by:
getIndexSet in class AbstractIndexedValueHandler
Parameters:
sourceValue - the source value of the node
Returns:
set of index values for the given source value or null
See Also:
com.sdm.quasar.client.core.data.plugin.impl.AbstractIndexedValueHandler#getIndexSet(java.lang.Object)