|
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.Object dk.rode.thesis.builder.AbstractExpressionBuilder<E> dk.rode.thesis.builder.TypedExpressionBuilder<E> dk.rode.thesis.builder.TypedComparableExpressionBuilder<E>
E
- The Comparable
type of values the constructed expressions
operate on and/or produces.@Participant(value="ConcreteBuilder") public class TypedComparableExpressionBuilder<E extends Comparable<? super E>>
A typed comparable expression builder construct various
TypedExpression
types having a Comparable
bound on
the value produced by the constructed expressions and on the
expression operands used.
Field Summary |
---|
Fields inherited from class dk.rode.thesis.builder.TypedExpressionBuilder |
---|
builder, type |
Fields inherited from class dk.rode.thesis.builder.AbstractExpressionBuilder |
---|
context, root, sequence |
Constructor Summary | |
---|---|
TypedComparableExpressionBuilder(Class<E> type,
ComparableExpressionBuilder<E> builder)
Constructor. |
|
TypedComparableExpressionBuilder(TypedComparableExpressionBuilder<E> builder)
Copy constructor. |
|
TypedComparableExpressionBuilder(TypedExpressionBuilder<E> builder)
Copy constructor. |
Method Summary | |
---|---|
TypedExpression<Boolean> |
buildGreaterThanExpression(Expression<E> first,
Expression<E> second)
Builds a new GREATER THAN expression. |
TypedExpression<E> |
buildSetExpression(Expression<E> value)
Builds a new SET expression. |
TypedExpression<Boolean> |
buildSmallerThanExpression(Expression<E> first,
Expression<E> second)
Builds a new SMALLER THAN expression. |
TypedComparableExpressionBuilder<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 TypedComparableExpressionBuilder(Class<E> type, ComparableExpressionBuilder<E> builder)
The same sequence
as used by builder
will be
used by this builder, but a new local context
will be
created and used.
type
- The class literal representing the type of value the
evaluation of constructed expressions produces; cannot
be null.builder
- The actual builder to use; cannot be null.
NullPointerException
- If either argument is null.public TypedComparableExpressionBuilder(TypedComparableExpressionBuilder<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.public TypedComparableExpressionBuilder(TypedExpressionBuilder<E> builder)
The same sequence
as used by builder
will be
used by this builder, but a new local context
will be
created and used.
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 TypedExpression<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 TypedExpression<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 TypedExpression<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 TypedComparableExpressionBuilder<E> copy()
Copyable
copy
in interface Copyable<ExpressionBuilder<E extends Comparable<? super E>>>
copy
in class TypedExpressionBuilder<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 |