public class ConstantExpression extends Object implements Expression
Expression
that is constant and will always evaluate
to a
static
(fixed) value.TRUE
,
FALSE
,
valueOf(boolean)
Modifier and Type | Field and Description |
---|---|
static ConstantExpression |
FALSE
|
static ConstantExpression |
TRUE
|
Modifier | Constructor and Description |
---|---|
private |
ConstantExpression()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Expression |
combine(Conjunction conjunction,
Collection<Expression> expressions) |
boolean |
evaluate() |
void |
format(ExpressionFormatter formatter,
Bracketing bracketing) |
boolean |
isConstant() |
Expression |
negate() |
static ConstantExpression |
valueOf(boolean value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
and, combine, or
public static final ConstantExpression TRUE
public static final ConstantExpression FALSE
public boolean evaluate()
evaluate
in interface Expression
true
if the expression is fulfilled, false
otherwise.Predicate.test(Object)
public Expression negate()
negate
in interface Expression
Expression
.public Expression combine(Conjunction conjunction, Collection<Expression> expressions)
combine
in interface Expression
conjunction
- 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 ConstantExpression valueOf(boolean value)
value
- the boolean
value the requested ConstantExpression
should evaluate
to.TRUE
if value
is true
, FALSE
otherwise.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.