dk.rode.thesis.visitor
Class StringValuedVisitableSequence<E extends CharSequence>
java.lang.Object
dk.rode.thesis.decorator.SequenceDecorator<E>
dk.rode.thesis.visitor.AbstractVisitableSequence<E>
dk.rode.thesis.visitor.StringValuedVisitableSequence<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>
@Participant(value="ConcreteElement")
public class StringValuedVisitableSequence<E extends CharSequence>
- extends AbstractVisitableSequence<E>
A string valued visitable sequence allows any sequence
delivering any CharSequence
type to
become value
visitable using the
SequenceValueVisitor.visitStringValued(Sequence, Object)
visitation method and is type
visitable for any known sub-interface of Sequence
that is implemented by the sequence.
- Author:
- Gunni Rode / rode.dk
- See Also:
DateValuedVisitableSequence
,
IntegerValuedVisitableSequence
,
ReflectiveVisitableSequence
Methods inherited from class dk.rode.thesis.decorator.SequenceDecorator |
bounded, consistent, current, equals, getSequence, getStringablePolicy, hashCode, next, reset, state, toString, toString, unique |
StringValuedVisitableSequence
public StringValuedVisitableSequence(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(SequenceValueVisitor<P> visitor,
P argument)
- Description copied from interface:
ValueVisitableSequence
- Visits this visitable sequence using the
value
visitor supplied
as visitor
.
- 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:
SequenceValueVisitor.visitStringValued(Sequence, Object)
copy
public StringValuedVisitableSequence<E> copy()
- Returns a deep copy of this object.
The decorated sequence is not copied.
- Returns:
- The copy; never null.
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.