|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unikassel.android.sdcframework.util.AbstractChainWorker<T>
T
- the workers client typepublic abstract class AbstractChainWorker<T>
Generic abstract Implementation of the "Chain of Responsibility" pattern..
Extending classes have to implement the process(Object)
method and
can override the doWork(Object)
method if necessary.
Field Summary | |
---|---|
private ChainWorker<T> |
successor
The successor |
Constructor Summary | |
---|---|
AbstractChainWorker()
Constructor |
Method Summary | |
---|---|
boolean |
doWork(T client)
The work method called by the client |
ChainWorker<T> |
getSuccessor()
The getter for the successor |
protected abstract boolean |
process(T client)
Processing method of the worker |
void |
setSuccessor(ChainWorker<T> successor)
The setter for the successor |
ChainWorker<T> |
withSuccessor(ChainWorker<T> successor)
A setter for the successor returning a reference to successor set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ChainWorker<T> successor
Constructor Detail |
---|
public AbstractChainWorker()
Method Detail |
---|
public boolean doWork(T client)
ChainWorker
doWork
in interface ChainWorker<T>
client
- the client to do the work for
protected abstract boolean process(T client)
client
- the client
public final ChainWorker<T> getSuccessor()
ChainWorker
getSuccessor
in interface ChainWorker<T>
public final void setSuccessor(ChainWorker<T> successor)
ChainWorker
setSuccessor
in interface ChainWorker<T>
successor
- the successor to setpublic final ChainWorker<T> withSuccessor(ChainWorker<T> successor)
ChainWorker
withSuccessor
in interface ChainWorker<T>
successor
- the successor to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |