T
- the type of element contained in repopublic interface Repository<T extends Identifiable> extends Serializable, Iterable<T>
Modifier and Type | Method and Description |
---|---|
void |
add(T element)
Add the given element
|
T |
get(String id)
Return element with the given id
|
Collection<T> |
getAll() |
T |
getCurrent() |
boolean |
remove(String id)
Remove the element with the given id
|
boolean |
remove(T element)
Remove the given element
|
boolean |
removeCurrent()
Remove the current Element
|
T |
setCurrent(String id)
Look for element with the given id, set it as current and return it
|
void |
setCurrent(T element)
Set the current element
|
T getCurrent()
Collection<T> getAll()
void setCurrent(T element)
element
- to set as currentT setCurrent(String id) throws IllegalArgumentException
id
- od the element to set as currentIllegalArgumentException
- if no element with the given id is foundT get(String id)
id
- a String id for the elementboolean removeCurrent()
boolean remove(String id)
id
- of the element to removeboolean remove(T element)
element
- to removevoid add(T element)
element
- to addCopyright © 2012-2013. All Rights Reserved.