Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

dk.rode.thesis.visitor
Class VisitableLongSequence

java.lang.Object
  extended by dk.rode.thesis.meta.model.AbstractSequence<Long>
      extended by dk.rode.thesis.meta.model.LongSequence
          extended by dk.rode.thesis.visitor.VisitableLongSequence
All Implemented Interfaces:
Sequence<Long>, Copyable<Sequence<Long>>, StrictCopyable<Sequence<Long>>, Stringable<Sequence<Long>>, TypeVisitableSequence<Long>, ValueVisitableSequence<Long>

@Participant(value="ConcreteElement")
public class VisitableLongSequence
extends LongSequence
implements ValueVisitableSequence<Long>, TypeVisitableSequence<Long>

A visitable long sequence is a LongSequence that is value visitable using the SequenceValueVisitor.visitLongValued(Sequence, Object) visitation method and is type visitable as well.

This sequence adds no additional state to a long sequence, only visitation behaviour.

Author:
Gunni Rode / rode.dk

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.meta.model.AbstractSequence
state
 
Constructor Summary
VisitableLongSequence()
          No-arg constructor.
VisitableLongSequence(long start)
          Constructor.
VisitableLongSequence(LongSequence sequence)
          Copy constructor.
 
Method Summary
<P> void
accept(SequenceTypeVisitor<P> visitor, P argument)
          Visits this visitable sequence using the type visitor supplied as visitor.
<P> void
accept(SequenceValueVisitor<P> visitor, P argument)
          Visits this visitable sequence using the value visitor supplied as visitor.
 VisitableLongSequence copy()
          Returns a copy of this sequence that will start at the same sequence index as this sequence.
 
Methods inherited from class dk.rode.thesis.meta.model.LongSequence
bounded, consistent, current, next, reset, unique
 
Methods inherited from class dk.rode.thesis.meta.model.AbstractSequence
getStringablePolicy, state, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface dk.rode.thesis.meta.model.Sequence
bounded, consistent, current, next, reset, state, unique
 
Methods inherited from interface dk.rode.thesis.strategy.Stringable
getStringablePolicy, toString
 

Constructor Detail

VisitableLongSequence

public VisitableLongSequence()
No-arg constructor.


VisitableLongSequence

public VisitableLongSequence(long start)
Constructor.

Parameters:
start - The start value of this sequence.

VisitableLongSequence

public VisitableLongSequence(LongSequence sequence)
Copy constructor.

Parameters:
sequence - The sequence to copy; cannot be null.
Throws:
NullPointerException - If sequence is null.
Method Detail

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<Long>
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:
SequenceVisitor.visitUnknown(Sequence, Object)

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.

Specified by:
accept in interface ValueVisitableSequence<Long>
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.visitLongValued(Sequence, Object)

copy

public VisitableLongSequence copy()
Description copied from interface: Sequence
Returns a copy of this sequence that will start at the same sequence index as this sequence.

Specified by:
copy in interface Sequence<Long>
Specified by:
copy in interface Copyable<Sequence<Long>>
Overrides:
copy in class LongSequence
Returns:
A copy of this sequence; never null.

Gunni Rode / rode.dk

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.