|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.inb.biomoby.central.model.AbstractModel<T>
public abstract class AbstractModel<T>
An abstract class for all BioMoby Registry models. Any BioMoby Registry model extends this class to provide a basic functionality such as an entity insertion/deletion/modification. The class also provides a basic notification mechanism through event listeners.
Constructor Summary | |
---|---|
AbstractModel()
|
Method Summary | |
---|---|
abstract boolean |
addElement(T element)
Method to add a model element. |
void |
addListener(ModelListener<T> listener)
Method to add a listener to be notified about a model changes. |
T |
getElement(T element)
Method returns a model element referenced by a provided one (using equals() method). |
abstract Collection<T> |
getElements()
|
abstract boolean |
removeElement(T element)
Method to remove a model element |
abstract boolean |
updateElement(T element1,
T element2)
A method that updates an element referred by element1 with data provided by element2 Note that updated element is not necesary the same object as elemen1, but those located in an underlied collection. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractModel()
Method Detail |
---|
public abstract Collection<T> getElements()
public T getElement(T element)
element
- - a reference object to find a model element using an equals() method
public abstract boolean addElement(T element)
element
- - an element to be added to the model
public abstract boolean removeElement(T element)
element
- - an element to be removed from the model
public abstract boolean updateElement(T element1, T element2)
element1
- - an object in a model to be updatedelement2
- - an object that used as a data source to updated object
public final void addListener(ModelListener<T> listener)
listener
- - a listener to be added to a list of listeners
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |