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

Class SimpsonsAndBouvierFamilySequence

  extended by dk.rode.thesis.meta.model.AbstractSequence<E>
      extended by dk.rode.thesis.meta.model.ArraySequence<String>
          extended by dk.rode.thesis.singleton.SimpsonsFamilySequence
              extended by dk.rode.thesis.singleton.SimpsonsAndBouvierFamilySequence
All Implemented Interfaces:
Sequence<String>, Copyable<Sequence<String>>, StrictCopyable<Sequence<String>>, Stringable<Sequence<String>>

public final class SimpsonsAndBouvierFamilySequence
extends SimpsonsFamilySequence

A Simpsons and Bouvier family sequence is a singleton sequence representing the primary family members in the The Simpsons and Bouvier families.

Only a single instance of this class is created, on demand only, and is available via the getFamily() method.

It is not possible to sub-class this class!

Implementation notes:
Any singleton instance in Java is only a singleton per class loader if created based on and utilising intrinsic class features.

Gunni Rode / rode.dk
See Also:
DanishAlphabetSequence, NorwegianAlphabetSequence, SimpsonsFamilySequence, SmileySequence

Nested Class Summary
private static class SimpsonsAndBouvierFamilySequence.Instance
          An instance container class that when loaded will create the SimpsonsAndBouvierFamilySequence instance to use and return from the getFamily() method.
Nested classes/interfaces inherited from interface dk.rode.thesis.meta.model.Sequence
Field Summary
private static String[] members
          The primary members in The Simpsons and Bouvier families.
static int SIZE
          The number of primary members in The Simpsons and Bouvier families.
Fields inherited from class dk.rode.thesis.meta.model.ArraySequence
elements, index
Fields inherited from class dk.rode.thesis.meta.model.AbstractSequence
Constructor Summary
private SimpsonsAndBouvierFamilySequence()
          Private no-arg constructor.
Method Summary
 SimpsonsAndBouvierFamilySequence copy()
          Returns this instance.
static SimpsonsAndBouvierFamilySequence getFamily()
          Returns the SimpsonsAndBouvierFamilySequence singleton instance to use.
Methods inherited from class dk.rode.thesis.singleton.SimpsonsFamilySequence
equals, hashCode
Methods inherited from class dk.rode.thesis.meta.model.ArraySequence
bounded, consistent, current, next, reset, size, unique
Methods inherited from class dk.rode.thesis.meta.model.AbstractSequence
getStringablePolicy, state, toString, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dk.rode.thesis.meta.model.Sequence
Methods inherited from interface dk.rode.thesis.strategy.Stringable
getStringablePolicy, toString

Field Detail


private static final String[] members
The primary members in The Simpsons and Bouvier families.


public static final int SIZE
The number of primary members in The Simpsons and Bouvier families.

Implementation notes:
Accessing this static field will before getFamily() will not cause the singleton instance to be created!

See Also:
DanishAlphabetSequence.SIZE, NorwegianAlphabetSequence.SIZE, SimpsonsFamilySequence.SIZE, SmileySequence.SIZE
Constructor Detail


private SimpsonsAndBouvierFamilySequence()
Private no-arg constructor.

SingletonError - If another class tries to invoke this constructor (via reflection).
Method Detail


public SimpsonsAndBouvierFamilySequence copy()
Returns this instance.

Specified by:
copy in interface Sequence<String>
Specified by:
copy in interface Copyable<Sequence<String>>
copy in class SimpsonsFamilySequence
This instance; never null.


public static SimpsonsAndBouvierFamilySequence getFamily()
Returns the SimpsonsAndBouvierFamilySequence singleton instance to use.

The singleton instance is not created before the first time this method is invoked!

Implementation notes:
This method hides the static SimpsonsFamilySequence.getFamily() method.

The sequence; never null.
See Also:

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.