|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wamblee.persistence.AbstractDetachable<T,Ref>
T - The type of the object to be attached/detachedRef - The type of the reference to store when the object is detached.public abstract class AbstractDetachable<T,Ref>
Detachable implementation that takes care of the basic logic for detachable
objects. All that needs to be done is to implement #load().
| Constructor Summary | |
|---|---|
protected |
AbstractDetachable(T aObject)
Constructs the detachable. |
| Method Summary | |
|---|---|
void |
detach()
Detaches the object. |
T |
get()
Gets the object, attaching it if needed. |
protected abstract Ref |
getReference(T aObject)
Obtains the reference for a given object. |
protected abstract T |
load(Ref aReference)
Loads the object based on a reference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractDetachable(T aObject)
aObject - Object.
IllegalArgumentException - When the object passed in is null.| Method Detail |
|---|
public void detach()
Detachable
detach in interface Detachable<T>public T get()
Detachable
get in interface Detachable<T>protected abstract T load(Ref aReference)
aReference - Reference.
protected abstract Ref getReference(T aObject)
aObject - Object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||