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

dk.rode.thesis.flyweight
Class Symbol

java.lang.Object
  extended by dk.rode.thesis.flyweight.AbstractCharacter
      extended by dk.rode.thesis.flyweight.Symbol
All Implemented Interfaces:
Character, Textual<Character>, Stringable<Character>, CharSequence, Comparable<Character>

@Participant(value="ConcreteFlyweight")
public class Symbol
extends AbstractCharacter

A symbol represents a single symbol that is not a whitespace or a letter.

Digits are also considered symbols.

Author:
Gunni Rode / rode.dk

Field Summary
private  char symbol
          The actual shared symbol.
 
Constructor Summary
Symbol(char symbol)
          Constructor.
 
Method Summary
 char charAt(int index)
           
 int compareTo(Character character)
           
 int length()
           
 CharSequence subSequence(int start, int end)
           
 String toString()
           
 
Methods inherited from class dk.rode.thesis.flyweight.AbstractCharacter
equals, getStringablePolicy, hashCode, indexOfIgnoreCase, lowerCaseFirst, toString, upperCaseFirst
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

symbol

private final char symbol
The actual shared symbol.

Constructor Detail

Symbol

Symbol(char symbol)
Constructor.

Parameters:
symbol -
Method Detail

charAt

public final char charAt(int index)

compareTo

public final int compareTo(Character character)

length

public final int length()

subSequence

public final CharSequence subSequence(int start,
                                      int end)

toString

public final String toString()
Specified by:
toString in interface CharSequence
Overrides:
toString in class Object

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.