public class ContactsDatabase extends Object implements Serializable
Constructor and Description |
---|
ContactsDatabase(long count)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
add(Contact contact) |
void |
delete(Contact contact)
delete contact from the database
|
List<Contact> |
find(long first,
long count,
String sortProperty,
boolean sortAsc)
select contacts and apply sort
|
Contact |
get(long id)
find contact by id
|
int |
getCount() |
protected List<Contact> |
getIndex(String prop,
boolean asc) |
void |
save(Contact contact)
add contact to the database
|
public ContactsDatabase(long count)
count
- number of contacts to generate at startuppublic Contact get(long id)
id
- protected void add(Contact contact)
public List<Contact> find(long first, long count, String sortProperty, boolean sortAsc)
first
- count
- sortProperty
- sortAsc
- public int getCount()
public void save(Contact contact)
contact
- public void delete(Contact contact)
contact
- Copyright © 2015. All rights reserved.