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

dk.rode.thesis.flyweight
Class Whitespace

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

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

A whitespace represents a single white space character.

Author:
Gunni Rode / rode.dk

Field Summary
(package private) static String space
          White space representation.
 
Constructor Summary
Whitespace()
          No-arg 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

space

static final String space
White space representation.

No internal state as all white space is represented as a single space... Tabs and newlines considered harmful... :)

See Also:
Constant Field Values
Constructor Detail

Whitespace

Whitespace()
No-arg constructor.

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.