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

dk.rode.thesis.interpreter
Interface InitialisableExpression<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:
FlowExpression, TypedExpressionDecorator, TypedFlowExpression

public interface InitialisableExpression<E>
extends Expression<E>

An initialisable expression represents an expression that require several steps to be constructed, and hence must be initialised before actual use.

After initialisation, the expression is considered immutable. Trying to alter it or initialise it again is an error.

Author:
Gunni Rode / rode.dk

Nested Class Summary
 
Nested classes/interfaces inherited from interface dk.rode.thesis.interpreter.Expression
Expression.SymbolIdiom
 
Method Summary
 InitialisableExpression<E> copy()
          Copies this initialisable expression.
 InitialisableExpression<E> initialise()
          Initialises this expression before evaluation.
 boolean isInitialised()
          Returns true if this expression has been initialised, and hence ready to be evaluated, false if not.
 
Methods inherited from interface dk.rode.thesis.interpreter.Expression
asSymbol, contains, evaluate, name, operands, toString
 

Method Detail

copy

InitialisableExpression<E> copy()
Copies this initialisable 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 initialisable expression; never null.

initialise

InitialisableExpression<E> initialise()
                                      throws ExpressionException
Initialises this expression before evaluation.

Contained initialisable expressions are not initialised!

Returns:
This expression; never null.
Throws:
ExpressionException - If this expression has already been initialised.

isInitialised

boolean isInitialised()
Returns true if this expression has been initialised, and hence ready to be evaluated, false if not.

If this expression has not been initialised when evaluated, the evaluation will throw an exception.

Returns:
True if initialised, false if not.

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.