|
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.decorator.SequenceDecorator<String> dk.rode.thesis.decorator.DuplexDecorator
@Participant(value="ConcreteDecorator") public class DuplexDecorator
A duplex sequence decorator returns the String value
returned by the decorated sequence concatenated with
the same value, for example x -> xx
.
Only sequences returning strings can be decorated.
The default stringable policy used is DecoratedPolicy.HIDDEN
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dk.rode.thesis.meta.model.Sequence |
---|
Sequence.State |
Field Summary |
---|
Fields inherited from class dk.rode.thesis.decorator.SequenceDecorator |
---|
sequence |
Constructor Summary | |
---|---|
DuplexDecorator(Sequence<String> sequence)
Constructor. |
Method Summary | |
---|---|
DuplexDecorator |
copy()
Returns a copy of this sequence that will start at the same sequence index as this sequence. |
String |
current()
Returns the current element from this sequence. |
String |
next()
Returns the next element from this sequence. |
Methods inherited from class dk.rode.thesis.decorator.SequenceDecorator |
---|
bounded, consistent, equals, getSequence, getStringablePolicy, hashCode, reset, state, toString, toString, unique |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dk.rode.thesis.meta.model.Sequence |
---|
bounded, consistent, reset, state, unique |
Methods inherited from interface dk.rode.thesis.strategy.Stringable |
---|
getStringablePolicy, toString |
Constructor Detail |
---|
public DuplexDecorator(@Participant(value="ConcreteComponent") Sequence<String> sequence)
sequence
- The sequence to decorate; cannot be null.
NullPointerException
- If sequence
is null.Method Detail |
---|
public DuplexDecorator copy()
Sequence
copy
in interface Sequence<String>
copy
in interface Copyable<Sequence<String>>
public String current()
Sequence
This method can be invoked even if Sequence.next()
has not been invoked yet, thus delivering the initial
value of this sequence.
current
in interface Sequence<String>
current
in class SequenceDecorator<String>
public String next()
Sequence
next
in interface Sequence<String>
next
in class SequenceDecorator<String>
Sequence.current()
,
Sequence.state()
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |