|
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.memento.Main
@Participant(value="Caretaker") public class Main
Memento tests.
Constructor Summary | |
---|---|
Main()
No-arg constructor. |
Method Summary | ||
---|---|---|
private static
|
checkAccess(Log out,
Map<MemorizableSequence<E>,SequenceMemento<E>> mementos,
Sequence<E> sequence)
Checks access rules to guarded mementos. |
|
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. |
|
static void |
main(String[] args)
Executes the Memento 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 checkAccess(Log out, Map<MemorizableSequence<E>,SequenceMemento<E>> mementos, Sequence<E> sequence)
E
- The type of values delivered by sequence
.out
- The log to use; never null.mementos
- The map to storing the created mementos; never null.sequence
- The sequence identifying the memento to use; never null.
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.
public static void main(String[] args)
args
- The arguments to supply to test(Log, Arguments)
,
if any; can be null.public boolean test(Log out, Arguments arguments)
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.
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 |