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

dk.rode.thesis.interpreter
Class Expression.SymbolIdiom

java.lang.Object
  extended by dk.rode.thesis.interpreter.Expression.SymbolIdiom
Enclosing interface:
Expression<E>

public static final class Expression.SymbolIdiom
extends Object

The symbol idiom ensures that cyclic expression references will be represented correctly in symbolic representation starting from a given expression.

Author:
Gunni Rode / rode.dk
See Also:
Context.reset(), Context.touch(Expression)

Constructor Summary
private Expression.SymbolIdiom()
          Private off-limit constructor.
 
Method Summary
static StringBuilder asSymbol(Context context, Expression<?> parent, Expression<?> child)
          See Expression.asSymbol(Context).
static StringBuilder asSymbol(Context context, Expression<?> parent, Expression<?> child, StringBuilder sb)
          See Expression.asSymbol(Context).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Expression.SymbolIdiom

private Expression.SymbolIdiom()
Private off-limit constructor.

Method Detail

asSymbol

public static final StringBuilder asSymbol(Context context,
                                           Expression<?> parent,
                                           Expression<?> child)
                                    throws ExpressionException
See Expression.asSymbol(Context).

Parameters:
context - The context to use; cannot be null.
parent - The parent expression; cannot be null.
child - The child expression; cannot be null.
Returns:
The symbolic representation; never null.
Throws:
NullPointerException - If either argument is null.
ExpressionException - If the symbol cannot be generated.

asSymbol

public static final StringBuilder asSymbol(Context context,
                                           Expression<?> parent,
                                           Expression<?> child,
                                           StringBuilder sb)
                                    throws ExpressionException
See Expression.asSymbol(Context).

Parameters:
context - The context to use; cannot be null.
parent - The parent expression; cannot be null.
child - The child expression; cannot be null.
sb - The string builder to append the symbolic representation to; cannot be null.
Returns:
sb; never null.
Throws:
NullPointerException - If either argument is null.
ExpressionException - If the symbol cannot be generated.

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.