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

dk.rode.thesis.builder
Class Main

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

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

Builder tests.

Author:
Gunni Rode / rode.dk

Constructor Summary
Main()
          No-arg constructor.
 
Method Summary
private
<E extends Comparable<? super E>>
Expression<E>
create(ComparableExpressionBuilder<E> builder, Class<E> type, E value)
          Builds: next[20], y = current, (reverse[true] ?
private  void log(boolean log)
          True to enable logging per expression type.
static void main(String[] args)
          Executes the Builder tests.
 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

create

private final <E extends Comparable<? super E>> Expression<E> create(ComparableExpressionBuilder<E> builder,
                                                                     Class<E> type,
                                                                     E value)
                                                          throws ExpressionException
Builds:
   next[20], y = current, (reverse[true] ? next[10], x = current, (x < value ? x : break[y]) : current)
 
Depending on builder, type information may be included.

Type Parameters:
E - The type of value the evaluation of the returned expression produces.
Parameters:
builder - The builder to use; cannot be null.
type - The actual type; cannot be null.
value - The value to use in the expression; cannot be null.
Returns:
The constructed expression; never null.
Throws:
NullPointerException - If either argument is null.
ExpressionException - If the construction fails.

log

private void log(boolean log)
True to enable logging per expression type.

Parameters:
log - True to enable verbose logging per expression type, false to disable.

main

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

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

test

public boolean test(Log out,
                    Arguments arguments)
Description copied from interface: Testable
Performs the specific tests and report the outcome to the log supplied as log.

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.