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

Interface TypedExpression<E>

Type Parameters:
E - The type of value the evaluation of this expression produces.
All Superinterfaces:
Copyable<Expression<E>>, Expression<E>, StrictCopyable<Expression<E>>
All Known Implementing Classes:
BreakExpression, ConstantExpression, TypedExpressionDecorator, TypedFlowExpression, VariableExpression

public interface TypedExpression<E>
extends Expression<E>

A typed expression exposes the type of the value its evaluation produces via its type() method.

Only typed expressions can be the target of a BreakExpression.

Break expressions are the only type of expression that is allowed to return null by the type() method.

Gunni Rode / rode.dk
See Also:

Nested Class Summary
Nested classes/interfaces inherited from interface dk.rode.thesis.interpreter.Expression
Method Summary
 TypedExpression<E> copy()
          Copies this typed expression.
 Class<E> type()
          Return the type of value the evaluation of this expression produces.
Methods inherited from interface dk.rode.thesis.interpreter.Expression
asSymbol, contains, evaluate, name, operands, toString

Method Detail


TypedExpression<E> copy()
Copies this typed expression.

Unlike Expression.asSymbol(Context), copying cannot handle cyclic expression references!

Specified by:
copy in interface Copyable<Expression<E>>
Specified by:
copy in interface Expression<E>
A copy of this typed expression; never null.


Class<E> type()
Return the type of value the evaluation of this expression produces.

The type. The only expression type allowed to return null is BreakExpression!

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.