|
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.Objectdk.rode.thesis.interpreter.AbstractExpression<E>
dk.rode.thesis.interpreter.SequenceExpression<E,E>
dk.rode.thesis.interpreter.CurrentExpression<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 CurrentExpression<E>
A current expression will invoke
current() on a given
sequence when evaluated.
NextExpression,
SetExpression,
ResetExpression,
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 | |
|---|---|
CurrentExpression(CurrentExpression<E> expression)
Copy constructor. |
|
CurrentExpression(Sequence<? extends E> sequence)
Constructor. |
|
CurrentExpression(Sequence<? extends E> sequence,
boolean includeHashCode)
Constructor. |
|
| Method Summary | |
|---|---|
CurrentExpression<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 CurrentExpression(CurrentExpression<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 CurrentExpression(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 CurrentExpression(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 CurrentExpression<E> copy()
Copyable
public E evaluate(Context context)
throws ExpressionException
ExpressionThere is no guarantee that the evaluation of this expression will terminate!
context - The context to use; cannot be null.
ExpressionException - If the evaluation fails.Sequence.current()public final String name()
Expression
current
|
Gunni Rode / rode.dk | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||