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

dk.rode.thesis.flyweight
Class Main

java.lang.Object
  extended by dk.rode.thesis.flyweight.Main
All Implemented Interfaces:
Testable

@Participant(value="Client")
public class Main
extends Object
implements Testable

Flyweight tests.

Author:
Gunni Rode / rode.dk

Constructor Summary
Main()
          No-arg constructor.
 
Method Summary
private static void indexOfIgnoreCase(Textual<?> textual, CharSequence token, Locale locale, Log out)
          Finds the indexes of token in textual and logs them to log.
static void main(String[] args)
          Executes the Flyweight tests.
private static Sentence parse(Log out, CharacterFactory factory, String string)
          Parses the string supplied as string into a sentence, which is printed and then returned.
 boolean test(Log out, Arguments arguments)
          Performs the specific tests and report the outcome to the log supplied as log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
No-arg constructor.

Method Detail

indexOfIgnoreCase

private static final void indexOfIgnoreCase(Textual<?> textual,
                                            CharSequence token,
                                            Locale locale,
                                            Log out)
Finds the indexes of token in textual and logs them to log.

Parameters:
textual - The textual object; never null.
token - The token to search for; never null.
locale - The local to use; never null.
out - The log to use.

main

public static void main(String[] args)
Executes the Flyweight tests.

Parameters:
args - The arguments to supply to test(Log, Arguments), if any; can be null.

parse

private static final Sentence parse(Log out,
                                    CharacterFactory factory,
                                    String string)
Parses the string supplied as string into a sentence, which is printed and then returned.

Parameters:
out - The log to use; never null.
factory - The character factory to use; never null.
string - The string to parse; never null.
Returns:
The constructed Sentence object; never null.

test

public boolean test(Log out,
                    Arguments arguments)
Performs the specific tests and report the outcome to the log supplied as log.

Arguments to control log-level:

Arguments to control log-level:

Specified by:
test in interface Testable
Parameters:
out - The log to report the test outcome to; cannot be null.
arguments - Additional arguments, if any.
Returns:
True if the tests succeeded, false if not.

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.