org.nuiton.web.tapestry5.data
Class AbstractMappedGridDataSource<K,E>

java.lang.Object
  extended by org.nuiton.web.tapestry5.data.AbstractMappedGridDataSource<K,E>
Type Parameters:
K - Type of the map key
E - Type of the map value
All Implemented Interfaces:
org.apache.tapestry5.grid.GridDataSource

public abstract class AbstractMappedGridDataSource<K,E>
extends Object
implements org.apache.tapestry5.grid.GridDataSource

AbstractMappedGridDataSource TODO : javadoc Created: 18 janv. 2010

Author:
fdesbois

Constructor Summary
AbstractMappedGridDataSource()
           
 
Method Summary
 boolean contains(K key)
           
protected abstract  int count()
           
protected abstract  Map<K,E> execute(int startIndex, int endIndex, org.apache.tapestry5.grid.SortConstraint orderBy)
           
 E get(K key)
           
 int getAvailableRows()
           
abstract  Class<?> getRowType()
          Need to be provided by subclass, used by Grid component
 Object getRowValue(int index)
           
protected  org.apache.tapestry5.grid.SortConstraint getSortConstraint(List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)
           
 boolean isPrepared()
          Detect if the data has already been prepared.
 void prepare(int startIndex, int endIndex, List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)
           
protected  String resolveOrderBy(org.apache.tapestry5.grid.SortConstraint orderBy)
           
 List<E> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMappedGridDataSource

public AbstractMappedGridDataSource()
Method Detail

getRowType

public abstract Class<?> getRowType()
Need to be provided by subclass, used by Grid component

Specified by:
getRowType in interface org.apache.tapestry5.grid.GridDataSource

count

protected abstract int count()

execute

protected abstract Map<K,E> execute(int startIndex,
                                    int endIndex,
                                    org.apache.tapestry5.grid.SortConstraint orderBy)

getAvailableRows

public int getAvailableRows()
Specified by:
getAvailableRows in interface org.apache.tapestry5.grid.GridDataSource

prepare

public void prepare(int startIndex,
                    int endIndex,
                    List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)
Specified by:
prepare in interface org.apache.tapestry5.grid.GridDataSource

getRowValue

public Object getRowValue(int index)
Specified by:
getRowValue in interface org.apache.tapestry5.grid.GridDataSource

isPrepared

public boolean isPrepared()
Detect if the data has already been prepared. This will prevent errors on calling get(Object), values() and contains(Object) methods.

Returns:
true if data is ready, false otherwise.

get

public E get(K key)

values

public List<E> values()

contains

public boolean contains(K key)

getSortConstraint

protected org.apache.tapestry5.grid.SortConstraint getSortConstraint(List<org.apache.tapestry5.grid.SortConstraint> sortConstraints)

resolveOrderBy

protected String resolveOrderBy(org.apache.tapestry5.grid.SortConstraint orderBy)


Copyright © 2010 CodeLutin. All Rights Reserved.