public class ConjunctionExpression extends Object implements Expression
Modifier and Type | Field and Description |
---|---|
private Conjunction |
conjunction |
private List<Expression> |
terms |
Modifier | Constructor and Description |
---|---|
private |
ConjunctionExpression(Conjunction conjunction,
List<Expression> terms)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Expression |
combine(Conjunction conj,
Collection<Expression> expressions) |
boolean |
evaluate() |
void |
format(ExpressionFormatter formatter,
Bracketing bracketing) |
Conjunction |
getConjunction() |
List<Expression> |
getTerms() |
boolean |
isConstant() |
Expression |
negate() |
static Expression |
valueOf(Conjunction conjunction,
Collection<Expression> expressions) |
static Expression |
valueOf(Conjunction conjunction,
Expression... expressions) |
static Expression |
valueOf(Expression expression,
Conjunction conjunction,
Collection<Expression> expressions) |
private static Expression |
valueOf(List<Expression> children,
Conjunction conjunction,
Collection<Expression> expressions) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, combine, or
private final Conjunction conjunction
private final List<Expression> terms
private ConjunctionExpression(Conjunction conjunction, List<Expression> terms)
conjunction
- - see getConjunction()
.terms
- the terms to combine.public Conjunction getConjunction()
Conjunction
.public List<Expression> getTerms()
unmodifiable
List
of the Expression
-Terms to
combine
with the conjunction
.public Expression negate()
negate
in interface Expression
Expression
.public boolean evaluate()
evaluate
in interface Expression
true
if the expression is fulfilled, false
otherwise.Predicate.test(Object)
public Expression combine(Conjunction conj, Collection<Expression> expressions)
combine
in interface Expression
conj
- the Conjunction
.expressions
- the Collection
of the Expression
s to combine with this one.Expression
combining this Expression
with the given Expression
s using the
given Conjunction
.public boolean isConstant()
isConstant
in interface Expression
true
if this is a constant
expression
that evaluates
to a fixed result, false
otherwise.public static Expression valueOf(Conjunction conjunction, Expression... expressions)
conjunction
- the conjunction
.expressions
- the Expression
terms
.Expression
. May be reduced and therefore does not have to be an instance of
ConjunctionExpression
.public static Expression valueOf(Conjunction conjunction, Collection<Expression> expressions)
conjunction
- the conjunction
.expressions
- the Expression
terms
.Expression
. May be reduced and therefore does not have to be an instance of
ConjunctionExpression
.public static Expression valueOf(Expression expression, Conjunction conjunction, Collection<Expression> expressions)
expression
- the start expression to combine
with the given
Expression
-Collection
.conjunction
- the conjunction
.expressions
- the Expression
terms
.Expression
. May be reduced and therefore does not have to be an instance of
ConjunctionExpression
.private static Expression valueOf(List<Expression> children, Conjunction conjunction, Collection<Expression> expressions)
public void format(ExpressionFormatter formatter, Bracketing bracketing)
format
in interface Expression
formatter
- the ExpressionFormatter
where to append
this Expression
.bracketing
- the Bracketing
.Copyright © 2001–2016 mmm-Team. All rights reserved.