org.apache.wicket.examples.repeater
Class ContactsDatabase

java.lang.Object
  extended by org.apache.wicket.examples.repeater.ContactsDatabase

public class ContactsDatabase
extends java.lang.Object

simple database for contacts

Author:
igor

Constructor Summary
ContactsDatabase(int count)
          Constructor
 
Method Summary
protected  void add(Contact contact)
           
 void delete(Contact contact)
          delete contact from the database
 java.util.List find(int first, int count, java.lang.String sortProperty, boolean sortAsc)
          select contacts and apply sort
 Contact get(long id)
          find contact by id
 int getCount()
           
protected  java.util.List getIndex(java.lang.String prop, boolean asc)
           
 void save(Contact contact)
          add contact to the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactsDatabase

public ContactsDatabase(int count)
Constructor

Parameters:
count - number of contacts to generate at startup
Method Detail

get

public Contact get(long id)
find contact by id

Parameters:
id -
Returns:
contact

add

protected void add(Contact contact)

find

public java.util.List find(int first,
                           int count,
                           java.lang.String sortProperty,
                           boolean sortAsc)
select contacts and apply sort

Parameters:
first -
count -
sortProperty -
sortAsc -
Returns:
list of contacts

getIndex

protected java.util.List getIndex(java.lang.String prop,
                                  boolean asc)

getCount

public int getCount()
Returns:
number of contacts in the database

save

public void save(Contact contact)
add contact to the database

Parameters:
contact -

delete

public void delete(Contact contact)
delete contact from the database

Parameters:
contact -


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