|
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.interpreter.AbstractExpression<E> dk.rode.thesis.interpreter.SequenceExpression<E,E> dk.rode.thesis.interpreter.ResetExpression<E>
E
- The type of value the evaluation of this expression
produces. The value corresponds to the (super-) type of
values delivered by the manipulated sequence
.@Participant(value="TerminalExpression") public class ResetExpression<E>
A reset expression will invoke reset()
on a given sequence
when evaluated.
CurrentExpression
,
NextExpression
,
SetExpression
,
ReverseExpression
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dk.rode.thesis.interpreter.Expression |
---|
Expression.SymbolIdiom |
Field Summary |
---|
Fields inherited from class dk.rode.thesis.interpreter.SequenceExpression |
---|
includeHashCode, sequence |
Constructor Summary | |
---|---|
ResetExpression(ResetExpression<E> expression)
Copy constructor. |
|
ResetExpression(Sequence<? extends E> sequence)
Constructor. |
|
ResetExpression(Sequence<? extends E> sequence,
boolean includeHashCode)
Constructor. |
Method Summary | |
---|---|
ResetExpression<E> |
copy()
Returns a deep copy of this object. |
E |
evaluate(Context context)
Evaluates this expression and returns the result. |
String |
name()
The stand-alone symbol name for this expression. |
Methods inherited from class dk.rode.thesis.interpreter.SequenceExpression |
---|
asSymbol, equals, hashCode, operands, toString |
Methods inherited from class dk.rode.thesis.interpreter.AbstractExpression |
---|
contains |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dk.rode.thesis.interpreter.Expression |
---|
contains |
Constructor Detail |
---|
public ResetExpression(ResetExpression<E> expression)
The actual sequence
manipulated by
expression
is not copied, but used
as is.
expression
- The expression to copy; cannot be null.
NullPointerException
- If expression
is null.public ResetExpression(Sequence<? extends E> sequence)
The identity hash code of sequence
is not included
in the symbolic
representation of
this expression.
sequence
- The sequence to manipulate by this expression;
cannot be null.
NullPointerException
- If sequence
is null.public ResetExpression(Sequence<? extends E> sequence, boolean includeHashCode)
The identity hash code of sequence
is included
in the symbolic
representation of
this expression if includeHashCode
is true.
sequence
- The sequence to manipulate by this expression;
cannot be null.includeHashCode
- True to include the identity hash code
of sequence
in the symbolic
representation, false not to.
NullPointerException
- If sequence
is null.Method Detail |
---|
public ResetExpression<E> copy()
Copyable
public E evaluate(Context context) throws ExpressionException
Expression
There is no guarantee that the evaluation of this expression will terminate!
context
- The context to use; cannot be null.
Sequence.reset()
has been invoked; never null.
ExpressionException
- If the evaluation fails.public final String name()
Expression
reset
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |