org.apache.wicket.examples.repeater
Class SortableContactDataProvider

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider<Contact>
      extended by org.apache.wicket.examples.repeater.SortableContactDataProvider
All Implemented Interfaces:
Serializable, ISortStateLocator, ISortableDataProvider<Contact>, IClusterable, IDataProvider<Contact>, IDetachable

public class SortableContactDataProvider
extends SortableDataProvider<Contact>

implementation of IDataProvider for contacts that keeps track of sort information

Author:
igor
See Also:
Serialized Form

Constructor Summary
SortableContactDataProvider()
          constructor
 
Method Summary
protected  ContactsDatabase getContactsDB()
           
 Iterator<Contact> iterator(int first, int count)
          Gets an iterator for the subset of total data
 IModel<Contact> model(Contact object)
          Callback used by the consumer of this data provider to wrap objects retrieved from IDataProvider.iterator(int, int) with a model (usually a detachable one).
 int size()
          Gets total number of items in the collection represented by the DataProvider
 
Methods inherited from class org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider
detach, getSort, getSortState, setSort, setSort, setSortState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortableContactDataProvider

public SortableContactDataProvider()
constructor

Method Detail

getContactsDB

protected ContactsDatabase getContactsDB()

iterator

public Iterator<Contact> iterator(int first,
                                  int count)
Description copied from interface: IDataProvider
Gets an iterator for the subset of total data

Parameters:
first - first row of data
count - minimum number of elements to retrieve
Returns:
iterator capable of iterating over {first, first+count} items
See Also:
IDataProvider.iterator(int, int)

size

public int size()
Description copied from interface: IDataProvider
Gets total number of items in the collection represented by the DataProvider

Returns:
total item count
See Also:
IDataProvider.size()

model

public IModel<Contact> model(Contact object)
Description copied from interface: IDataProvider
Callback used by the consumer of this data provider to wrap objects retrieved from IDataProvider.iterator(int, int) with a model (usually a detachable one).

Parameters:
object - the object that needs to be wrapped
Returns:
the model representation of the object
See Also:
IDataProvider.model(java.lang.Object)


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.