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

dk.rode.thesis.iterator
Class Main

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

public class Main
extends Object
implements Testable

Iterator tests.

Author:
Gunni Rode / rode.dk

Constructor Summary
Main()
          No-arg constructor.
 
Method Summary
private static
<V> void
iterate(Log out, int index, Sequence<V> sequence, int valuesPerLine, boolean recurse)
          Iterates over the sequence values in sequence.
private static
<V> void
iterate(Log out, IterableSequence<V> sequence, int valuesPerLine, boolean recurse)
          Iterates over the sequence values delivered by sequence.
private static
<V> void
iterate(Log out, SequenceIterator<V> iterator, int valuesPerLine, boolean recurse)
          Iterates over the sequence values delivered indirectly by iterator.
static void main(String[] args)
          Executes the Iterator 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

iterate

private static final <V> void iterate(Log out,
                                      int index,
                                      Sequence<V> sequence,
                                      int valuesPerLine,
                                      boolean recurse)
Iterates over the sequence values in sequence.

Type Parameters:
V - The type of values delivered by sequence.
Parameters:
out - The log to use; never null.
index - The sequence index.
sequence - The sequence; never null.
valuesPerLine - Number of sequence values to log per line.
recurse - True to recurse.

iterate

private static final <V> void iterate(Log out,
                                      IterableSequence<V> sequence,
                                      int valuesPerLine,
                                      boolean recurse)
Iterates over the sequence values delivered by sequence.

Type Parameters:
V - The type of values delivered by sequence.
Parameters:
out - The log to use; never null.
sequence - The sequence; never null.
valuesPerLine - Number of sequence values to log per line.
recurse - True to recurse.

iterate

private static final <V> void iterate(Log out,
                                      SequenceIterator<V> iterator,
                                      int valuesPerLine,
                                      boolean recurse)
Iterates over the sequence values delivered indirectly by iterator.

Type Parameters:
V - The type of values delivered by sequence.
Parameters:
out - The log to use; never null.
iterator - The iterator; never null.
valuesPerLine - Number of sequence values to log per line.
recurse - True to recurse.

main

public static void main(String[] args)
Executes the Iterator 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.