|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.rode.thesis.bridge.Main
public class Main
Bridge tests.
Constructor Summary | |
---|---|
Main()
No-arg constructor. |
Method Summary | ||
---|---|---|
private static
|
create(Log out,
Map<MemorizableSequence<E>,SequenceMemento<E>> mementos,
MemorizableSequence<E> sequence)
Creates a new memento acquired from sequence . |
|
private static
|
createMap()
Creates a new map to store (memorizable sequence, memento) pairs. |
|
private static boolean |
equals(Object a,
Object b)
Test for equality including support for proxies. |
|
static void |
main(String[] args)
Executes the Bridge tests. |
|
boolean |
test(Log out,
Arguments arguments)
Performs the specific tests and report the outcome to the log supplied as log . |
|
private static
|
use(Log out,
Map<MemorizableSequence<E>,SequenceMemento<E>> mementos,
MemorizableSequence<E> sequence)
Updates sequence using the relevant memento stored in
mementos . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Main()
Method Detail |
---|
private static final <E> boolean create(Log out, Map<MemorizableSequence<E>,SequenceMemento<E>> mementos, MemorizableSequence<E> sequence)
sequence
.
E
- The type of values delivered by sequence
.out
- The log to use; never null.mementos
- The map to store the created memento; never null.sequence
- The sequence to create the memento; never null.
private static final <E> Map<MemorizableSequence<E>,SequenceMemento<E>> createMap()
E
- The type of values delivered by applicable sequences.
private static final boolean equals(Object a, Object b)
a
- The first object; cannot be null.b
- The second object; cannot be null.
public static void main(String[] args) throws Exception
args
- The arguments to supply to test(Log, Arguments)
,
if any; can be null.
Exception
- If the test fails unexpectedly.public boolean test(Log out, Arguments arguments) throws Exception
Testable
log
supplied as log
. Arguments to control log-level:
-log
: a boolean value (as a string) indicating if
class logging is enabled for relevant classes.
-log.verbose
: a boolean value (as a string) indicating
if class logging is enabled for relevant classes that generates
verbose output.
test
in interface Testable
out
- The log to report the test outcome to; cannot be null.arguments
- Additional arguments, if any.
NullPointerException
- If out
is null.
Exception
- In case an unexpected error occurs.private static final <E> boolean use(Log out, Map<MemorizableSequence<E>,SequenceMemento<E>> mementos, MemorizableSequence<E> sequence)
sequence
using the relevant memento stored in
mementos
.
E
- The type of values delivered by sequence
.out
- The log to use; never null.mementos
- The map to storing the created memento; never null.sequence
- The sequence to be updated; never null.
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |