|
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.Object dk.rode.thesis.observer.CorrelatedSequenceObserver
@Participant(value="ConcreteObserver") public class CorrelatedSequenceObserver
A correlated sequence observer correlates the behaviour
of an observable
sequence with another
(perhaps observable) Sequence
.
When Sequence.next()
is invoked on the observed sequence,
next
is invoked on the correlated sequence. The same is
true for Sequence.reset()
, either if implicit in form of
a bounded sequence that wraps, or because the reset()
method was explicitly invoked.
Field Summary | |
---|---|
private Sequence<?> |
sequence
The correlated sequence. |
Constructor Summary | |
---|---|
CorrelatedSequenceObserver(Sequence<?> sequence)
Constructor. |
Method Summary | |
---|---|
void |
sequenceEvent(Sequence<?> sequence,
Sequence.State state)
Notification method that is invoked when the sequence supplied as sequence
has changed its state to state . |
String |
toString()
Returns the string representation of this observer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final Sequence<?> sequence
Never null.
Constructor Detail |
---|
public CorrelatedSequenceObserver(Sequence<?> sequence)
sequence
- The sequence to correlate; cannot be null.
NullPointerException
- If sequence
is null.Method Detail |
---|
public void sequenceEvent(Sequence<?> sequence, Sequence.State state)
SequenceObserver
sequence
supplied as sequence
has changed its state to state
.
The type of sequence is not defined; it cannot be assumed
observable
, or even of the type
this observer was attached to; it might be adapted, decorated,
composite, or proxied.
sequenceEvent
in interface SequenceObserver<Sequence.State>
sequence
- This sequence; cannot be null.state
- The current (new) aspect; cannot be null.public String toString()
toString
in class Object
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |