dk.rode.thesis.memento
Interface MemorizableSequence<E>
- Type Parameters:
E
- The type of values delivered by this memorizable sequence.
- All Superinterfaces:
- Copyable<Sequence<E>>, Sequence<E>, StrictCopyable<Sequence<E>>, Stringable<Sequence<E>>
- All Known Implementing Classes:
- MemorizableEnglishAlphabetSequence, MemorizableSequenceAbstraction, RangeSequence
@Participant(value="Originator")
public interface MemorizableSequence<E>
- extends Sequence<E>
A memorizable sequence can memorise its internal state
at a given time and have it restored again later by
using mementos
.
- Author:
- Gunni Rode / rode.dk
getMemorizableState
SequenceMemento<E> getMemorizableState()
- Returns a sequence memento representing the current state
of this sequence.
- Returns:
- The memento; never null.
setMemorizableState
void setMemorizableState(SequenceMemento<E> memento)
throws MemorizableException
- Updates this sequence to the state supplied as
memento
.
- Parameters:
memento
- The memento supplying the state; cannot be null.
- Throws:
NullPointerException
- If memento
is null.
MemorizableException
- If the update fails, e.g. illegal
memento state for this sequence, or illegal memento type.
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.