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

dk.rode.thesis.interpreter
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.

Author:
Gunni Rode / rode.dk
See Also:
TypedExpressionDecorator

Nested Class Summary
 
Nested classes/interfaces inherited from interface dk.rode.thesis.interpreter.Expression
Expression.SymbolIdiom
 
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

copy

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>
Returns:
A copy of this typed expression; never null.

type

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

Returns:
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.