|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdk.rode.thesis.meta.reflect.CallerClass.CallerIterator<C>
C - The specific (sub-) type of the caller class to iterate over.protected abstract static class CallerClass.CallerIterator<C extends CallerClass>
A caller iterator is used to iterator over CallerClass
instances, or sub-classes of it.
Implementation notes:
This is an application of the Iterator
pattern specialised for sub-classes of CallerClass. The
setNext() method can on a fine day be considered an application
of the Factory Method pattern.
| Field Summary | |
|---|---|
protected C |
caller
The current caller set by setNext(). |
| Constructor Summary | |
|---|---|
CallerClass.CallerIterator(C caller)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
hasNext()
Returns true if additional callers are in the call-stack, false if not. |
C |
next()
Returns the next caller. |
void |
remove()
Always throws an UnsupportedOperationException. |
(package private) abstract void |
setNext()
Sets the next caller class, or sub-class or it, to
be retrieved by the next call to next(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected C extends CallerClass caller
setNext(). Never null.
| Constructor Detail |
|---|
CallerClass.CallerIterator(C caller)
caller - The caller to start from; can be null.| Method Detail |
|---|
public boolean hasNext()
hasNext in interface Iterator<C extends CallerClass>public C next()
next in interface Iterator<C extends CallerClass>public void remove()
UnsupportedOperationException.
remove in interface Iterator<C extends CallerClass>UnsupportedOperationException - Always thrown.abstract void setNext()
next caller class, or sub-class or it, to
be retrieved by the next call to next().
|
Gunni Rode / rode.dk | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||