|
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 |
java.lang.Objectdk.rode.thesis.builder.AbstractExpressionBuilder<E>
dk.rode.thesis.builder.StandardExpressionBuilder<E>
dk.rode.thesis.builder.StandardComparableExpressionBuilder<E>
E
- The Comparable
type of values the constructed expressions
operate on and/or produces.@Participant(value="ConcreteBuilder") public class StandardComparableExpressionBuilder<E extends Comparable<? super E>>
A comparable expression builder construct various Expression
types having a Comparable
bound on the value produced by
the constructed expressions and on the expression operands used.
The constructed terminal
expressions
will all manipulate the same sequence
instance.
A comparable expression builder uses a context
to
register all unique instances of constructed variables
and store all created constants
.
Field Summary |
---|
Fields inherited from class dk.rode.thesis.builder.AbstractExpressionBuilder |
---|
context, root, sequence |
Constructor Summary | |
---|---|
StandardComparableExpressionBuilder(Context context,
Sequence<? extends E> sequence)
Constructor. |
|
StandardComparableExpressionBuilder(Sequence<? extends E> sequence)
Constructor. |
|
StandardComparableExpressionBuilder(StandardComparableExpressionBuilder<E> builder)
Copy constructor. |
Method Summary | |
---|---|
Expression<Boolean> |
buildGreaterThanExpression(Expression<E> first,
Expression<E> second)
Builds a new GREATER THAN expression. |
Expression<E> |
buildSetExpression(Expression<E> value)
Builds a new SET expression. |
Expression<Boolean> |
buildSmallerThanExpression(Expression<E> first,
Expression<E> second)
Builds a new SMALLER THAN expression. |
StandardComparableExpressionBuilder<E> |
copy()
Returns a deep copy of this object. |
Methods inherited from class dk.rode.thesis.builder.AbstractExpressionBuilder |
---|
buildConstantExpression, buildExpression, buildVariableExpression, equals, getContext, getRootExpression, getSequence, hashCode, initialiseExpressions, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StandardComparableExpressionBuilder(Context context, Sequence<? extends E> sequence)
The context
supplied as context
is
used to register created variables
and store constants
.
context
- The context to use; cannot be null.sequence
- The sequence to be manipulated by constructed
terminal expressions; cannot be null.
NullPointerException
- If either argument is null.AbstractExpressionBuilder.getContext()
public StandardComparableExpressionBuilder(Sequence<? extends E> sequence)
A local context
is used to register created
variables
and store
constants
.
sequence
- The sequence to be manipulated by constructed
terminal expressions; cannot be null.
NullPointerException
- If sequence
is null.AbstractExpressionBuilder.getContext()
public StandardComparableExpressionBuilder(StandardComparableExpressionBuilder<E> builder)
The same context
and sequence
as used by builder
will be used by this builder.
The root expression from builder
is not copied.
Hence, this builder is ready to construct new expressions, and
return a unique root expression from AbstractExpressionBuilder.getRootExpression()
.
builder
- The builder to copy; cannot be null.
NullPointerException
- If builder
is null.Method Detail |
---|
public Expression<Boolean> buildGreaterThanExpression(Expression<E> first, Expression<E> second)
ComparableExpressionBuilder
buildGreaterThanExpression
in interface ComparableExpressionBuilder<E extends Comparable<? super E>>
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
public Expression<E> buildSetExpression(Expression<E> value)
ComparableExpressionBuilder
buildSetExpression
in interface ComparableExpressionBuilder<E extends Comparable<? super E>>
value
- The expression that will determine the sequence
value to fast-forward to for the sequence
when the constructed expression is
evaluated.
public Expression<Boolean> buildSmallerThanExpression(Expression<E> first, Expression<E> second)
ComparableExpressionBuilder
buildSmallerThanExpression
in interface ComparableExpressionBuilder<E extends Comparable<? super E>>
first
- The first expression operand; cannot be null.second
- The second expression operand; cannot be null.
public StandardComparableExpressionBuilder<E> copy()
Copyable
copy
in interface Copyable<ExpressionBuilder<E extends Comparable<? super E>>>
copy
in class StandardExpressionBuilder<E extends Comparable<? super E>>
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |