Class ContactsDatabase
- java.lang.Object
-
- org.apache.wicket.examples.repeater.ContactsDatabase
-
public class ContactsDatabase extends Object
simple database for contacts- Author:
- igor
-
-
Constructor Summary
Constructors Constructor Description ContactsDatabase(int count)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(Contact contact)voiddelete(Contact contact)delete contact from the databaseList<Contact>find(long first, long count, SortParam sort)select contacts and apply sortContactget(long id)find contact by idintgetCount()List<Contact>getIndex(SortParam sort)voidsave(Contact contact)add contact to the database
-
-
-
Method Detail
-
get
public Contact get(long id)
find contact by id- Parameters:
id-- Returns:
- contact
-
add
protected void add(Contact contact)
-
find
public List<Contact> find(long first, long count, SortParam sort)
select contacts and apply sort- Parameters:
first-count-sort-- Returns:
- list of contacts
-
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-
-
-