|
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 |
E
- The main type of values the constructed expressions
operate on and/or produces.@ParticipantUsage(value="Product", type=Expression.class) @Participant(value="Builder") public interface ExpressionBuilder<E>
An expression builder construct various Expression
types having no bounds on the values produced by the
constructed expressions.
The constructed root expression can be fetched using
the getRootExpression()
method, and expressions
can be added to it using the buildExpression(Expression)
method.
Method Summary | ||
---|---|---|
Expression<Boolean> |
buildAndExpression(Expression<Boolean> first,
Expression<Boolean> second)
Builds a new short-circuit AND expression. |
|
Expression<E> |
buildAssignmentExpression(VariableExpression<E> variable,
Expression<? extends E> expression)
Builds a new ASSIGNMENT expression. |
|
Expression<E> |
buildBreakExpression(TypedExpression<E> expression)
Builds a new BREAK expression. |
|
Expression<E> |
buildConditionalExpression(Expression<Boolean> condition,
Expression<? extends E> first,
Expression<? extends E> second)
Builds a new CONDITIONAL expression. |
|
|
buildConstantExpression(Class<V> type,
V value)
Builds a new CONSTANT expression. |
|
Expression<E> |
buildCurrentExpression()
Builds a new CURRENT expression. |
|
Expression<Boolean> |
buildEqualExpression(Expression<?> first,
Expression<?> second)
Builds a new EQUAL expression. |
|
void |
buildExpression(Expression<? extends E> expression)
Adds the constructed expression supplied
as expression to the root
expression constructed by this builder. |
|
FlowExpression<E> |
buildFlowExpression()
Builds a new uninitialised
FLOW expression. |
|
Expression<E> |
buildInitialisedFlowExpression(Expression<? extends E>... expressions)
Builds a new initialised
FLOW expression. |
|
Expression<E> |
buildNextExpression(Expression<? extends Number> count)
Builds a new NEXT expression. |
|
Expression<Boolean> |
buildNonShortCircuitAndExpression(Expression<Boolean> first,
Expression<Boolean> second)
Builds a new non short-circuit AND expression. |
|
Expression<Boolean> |
buildNonShortCircuitOrExpression(Expression<Boolean> first,
Expression<Boolean> second)
Builds a new non short-circuit OR expression. |
|
Expression<Boolean> |
buildNotExpression(Expression<Boolean> expression)
Builds a new NOT expression. |
|
Expression<Boolean> |
buildOrExpression(Expression<Boolean> first,
Expression<Boolean> second)
Builds a new short-circuit OR expression. |
|
Expression<E> |
buildResetExpression()
Builds a new RESET expression. |
|
Expression<Boolean> |
buildReverseExpression(Expression<Boolean> reverse)
Builds a new REVERSE expression. |
|
|
buildVariableExpression(Class<V> type,
String name)
Builds a new VARIABLE expression. |
|
Expression<E> |
getRootExpression()
Returns the root expression constructed by this builder. |
|
Sequence<? extends E> |
getSequence()
Returns the sequence manipulated by the
terminal expressions constructed by this builder. |
Methods inherited from interface dk.rode.thesis.prototype.Copyable |
---|
copy |
Method Detail |
---|
Expression<Boolean> buildAndExpression(Expression<Boolean> first, Expression<Boolean> second)
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.Expression<E> buildAssignmentExpression(VariableExpression<E> variable, Expression<? extends E> expression)
variable
- The variable to be assigned the result of the
evaluation of expression
; cannot be null,
or be a constant
.expression
- The expression to deliver the variable value when
evaluated; cannot be null.
NullPointerException
- If either argument is null.
IllegalArgumentException
- If variable
is a constant.Expression<E> buildBreakExpression(TypedExpression<E> expression)
expression
- The target expression, if any; can be null.
Expression<E> buildConditionalExpression(Expression<Boolean> condition, Expression<? extends E> first, Expression<? extends E> second)
condition
- The condition expression; cannot be null.first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.<V> Expression<V> buildConstantExpression(Class<V> type, V value) throws ExpressionException
V
- The type of value the constructed expression
produces.type
- The type of the constant represented by the
constructed expression; cannot be null.value
- The value of the constant; cannot be null.
NullPointerException
- If either expression is null.
ExpressionException
- If the building fails.Expression<E> buildCurrentExpression()
Expression<Boolean> buildEqualExpression(Expression<?> first, Expression<?> second)
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.void buildExpression(Expression<? extends E> expression) throws ExpressionException
expression
supplied
as expression
to the root
expression constructed by this builder.
If expression
is initialisable
but not initialised
,
it will be initialised when the root expression is returned.
expression
- The expression to add; cannot be null.
NullPointerException
- If expression
is null.
ExpressionException
- If the adding fails in case the
root expression has already been fetched.FlowExpression<E> buildFlowExpression()
uninitialised
FLOW expression.
Expression<E> buildInitialisedFlowExpression(Expression<? extends E>... expressions) throws ExpressionException
initialised
FLOW expression.
expressions
- The expressions, in order, to be
associated with the returned expression;
cannot be null.
NullPointerException
- If expressions
is null, or
contain a null entry.
ExpressionException
- If the building fails.Expression<E> buildNextExpression(Expression<? extends Number> count)
count
- The expression that will determine the number
of times next()
will be invoked on
the sequence
when the
constructed expression is evaluated.
NullPointerException
- If count
is null.Expression<Boolean> buildNonShortCircuitAndExpression(Expression<Boolean> first, Expression<Boolean> second)
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.Expression<Boolean> buildNonShortCircuitOrExpression(Expression<Boolean> first, Expression<Boolean> second)
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.Expression<Boolean> buildNotExpression(Expression<Boolean> expression)
expression
- The expression operand; cannot be null.
NullPointerException
- If expression
is null.Expression<Boolean> buildOrExpression(Expression<Boolean> first, Expression<Boolean> second)
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
NullPointerException
- If either expression is null.Expression<E> buildResetExpression()
Expression<Boolean> buildReverseExpression(Expression<Boolean> reverse)
reverse
- The expression that will determine if the
sequence
is tried
reversed when the constructed expression is
evaluated.
NullPointerException
- If reverse
is null.<V> VariableExpression<V> buildVariableExpression(Class<V> type, String name) throws ExpressionException
V
- The type of value the constructed expression
produces.type
- The type of the value represented by
the constructed expression; cannot be null.name
- The name of the constructed expression; cannot be
null or empty.
NullPointerException
- If either argument is null.
IllegalArgumentException
- If name
is illegal.
ExpressionException
- If the building fails.Expression<E> getRootExpression() throws ExpressionException
Expressions are added to the root expression using the
buildExpression(Expression)
method. Once the
root expression has been returned once, additional
expressions cannot be added to it!
All initialisable
expressions
contained in the root expression will have been
initialised
,
if not already.
ExpressionException
- If the initialisation fails.Sequence<? extends E> getSequence()
sequence
manipulated by the
terminal expressions constructed by this builder.
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |