public class BooleanExpression extends Object
Modifier and Type | Field and Description |
---|---|
protected List<BooleanExpression> |
children |
static BooleanExpression |
FALSE |
protected static int |
OPERAND |
protected static int |
OPERATOR_AND |
protected static int |
OPERATOR_NOT |
protected static int |
OPERATOR_OR |
protected int |
operatorType |
static BooleanExpression |
TRUE |
Modifier | Constructor and Description |
---|---|
protected |
BooleanExpression(int operatorType)
创建一个实例
|
Modifier and Type | Method and Description |
---|---|
void |
addOperand(BooleanExpression... operands)
给表达式增加运算数
|
void |
addOperand(BooleanExpression operand)
给表达式增加运算数
|
void |
addOperand(Collection<? extends BooleanExpression> operands)
给表达式增加运算数
|
static BooleanExpression |
AND(BooleanExpression... operands)
创建用AND连接的表达式
|
static BooleanExpression |
AND(Collection<? extends BooleanExpression> operands)
创建用AND连接的表达式
|
boolean |
evaluate()
用null作为context获得表达式的结果。子类不必重载这个方法。
|
boolean |
evaluate(Object context)
获得表达式的结果。子类可以重载这个方法。
|
static BooleanExpression |
HAS(Object obj) |
static BooleanExpression |
NOT(BooleanExpression operand)
创建用NOT修饰的表达式
|
static BooleanExpression |
OR(BooleanExpression... operands)
创建用OR连接的表达式
|
static BooleanExpression |
OR(Collection<? extends BooleanExpression> operands)
创建用OR连接的表达式
|
String |
toString()
转成字符串表示。子类可以重载这个方法。
|
protected static final int OPERATOR_AND
protected static final int OPERATOR_OR
protected static final int OPERATOR_NOT
protected static final int OPERAND
public static final BooleanExpression TRUE
public static final BooleanExpression FALSE
protected int operatorType
protected List<BooleanExpression> children
protected BooleanExpression(int operatorType)
operatorType
- public static BooleanExpression AND(BooleanExpression... operands)
operands
- public static BooleanExpression AND(Collection<? extends BooleanExpression> operands)
operands
- public static BooleanExpression OR(BooleanExpression... operands)
operands
- public static BooleanExpression OR(Collection<? extends BooleanExpression> operands)
operands
- public static BooleanExpression NOT(BooleanExpression operand)
operand
- public static BooleanExpression HAS(Object obj)
public void addOperand(BooleanExpression operand)
operand
- public void addOperand(BooleanExpression... operands)
operands
- public void addOperand(Collection<? extends BooleanExpression> operands)
operands
- public boolean evaluate(Object context)
context
- public boolean evaluate()
Copyright © 2014. All Rights Reserved.