dk.rode.thesis.prototype
Class CountdownSequence
java.lang.Object
dk.rode.thesis.meta.model.AbstractSequence<E>
dk.rode.thesis.meta.model.ArraySequence<String>
dk.rode.thesis.prototype.CountdownSequence
- All Implemented Interfaces:
- Sequence<String>, Copyable<Sequence<String>>, StrictCopyable<Sequence<String>>, Stringable<Sequence<String>>
@Participant(value="ConcretePrototype")
public class CountdownSequence
- extends ArraySequence<String>
A non-copyable count-down sequence is a singleton sequence used
for count-downs:
Five, Four, Three, Two, One, FIRE!
Invoking clone()
will always throw a
CloneNotSupportedException
, and the copy()
method returns the same instance.
A count-down sequence is bounded
,
consistent
, and
unique
.
- Author:
- Gunni Rode / rode.dk
Field Summary |
private static String[] |
elements
The various elements in a count-down sequence. |
private static CountdownSequence |
instance
Single instance of the sequence, initialised thread-safe at class
loading time. |
Methods inherited from interface dk.rode.thesis.meta.model.Sequence |
state |
elements
private static final String[] elements
- The various elements in a count-down sequence.
instance
private static final CountdownSequence instance
- Single instance of the sequence, initialised thread-safe at class
loading time.
Never null.
CountdownSequence
private CountdownSequence()
- No-arg constructor.
clone
public CountdownSequence clone()
throws CloneNotSupportedException
- Always throws a
CloneNotSupportedException
.
- Overrides:
clone
in class Object
- Returns:
- Never returns.
- Throws:
CloneNotSupportedException
- Always thrown.
copy
public CountdownSequence copy()
- Description copied from interface:
Sequence
- Returns a copy of this sequence that will start at the
same sequence index as this sequence.
- Returns:
- A copy of this sequence; never null.
getInstance
public static final CountdownSequence getInstance()
- Returns the
CountdownSequence
instance to use.
- Returns:
- The sequence; 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.