dk.rode.thesis.visitor
Class AbstractVisitableSequence<E>
java.lang.Object
dk.rode.thesis.decorator.SequenceDecorator<E>
dk.rode.thesis.visitor.AbstractVisitableSequence<E>
- Type Parameters:
E
- The type of values delivered by this visitable sequence.
- All Implemented Interfaces:
- Sequence<E>, Copyable<Sequence<E>>, StrictCopyable<Sequence<E>>, Stringable<Sequence<E>>, TypeVisitableSequence<E>, ValueVisitableSequence<E>
- Direct Known Subclasses:
- DateValuedVisitableSequence, IntegerValuedVisitableSequence, ReflectiveVisitableSequence, StringValuedVisitableSequence
@Participant(value="Element")
public abstract class AbstractVisitableSequence<E>
- extends SequenceDecorator<E>
- implements ValueVisitableSequence<E>, TypeVisitableSequence<E>
Any sequence decorated by an abstract visitable sequence
implementation is value
and
type
visitable.
Implementation notes:
The Decorator pattern is used
to implement this visitable sequence.
The type visitable functionality is implemented by this class,
but the value visitable functionality has to be implemented
by specific sub-classes.
- Author:
- Gunni Rode / rode.dk
Methods inherited from class dk.rode.thesis.decorator.SequenceDecorator |
bounded, consistent, current, equals, getSequence, getStringablePolicy, hashCode, next, reset, state, toString, toString, unique |
AbstractVisitableSequence
protected AbstractVisitableSequence(Sequence<E> sequence)
- Constructor.
- Parameters:
sequence
- The decorated sequence that will become visitable;
cannot be null.
- Throws:
NullPointerException
- If sequence
is null.
accept
public <P> void accept(SequenceTypeVisitor<P> visitor,
P argument)
- Description copied from interface:
TypeVisitableSequence
- Visits this visitable sequence using the
type
visitor supplied
as visitor
.
- Specified by:
accept
in interface TypeVisitableSequence<E>
- Type Parameters:
P
- The type of visitor-supplied argument. Use Void
for visitors that do not need an additional argument.- Parameters:
visitor
- The visitor; never null.argument
- A context supplied argument, if any.- See Also:
SequenceTypeScanner.scan(TypeVisitableSequence, SequenceTypeVisitor, Object)
Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!
The original thesis and source code are available at rode.dk/thesis.