com.scudata.dw.NodeFilter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of esproc Show documentation
Show all versions of esproc Show documentation
SPL(Structured Process Language) A programming language specially for structured data computing.
The newest version!
package com.scudata.dw;
import com.scudata.dm.Context;
import com.scudata.dm.Param;
import com.scudata.expression.Expression;
import com.scudata.expression.Node;
import com.scudata.util.Variant;
public class NodeFilter extends IFilter {
private Node node;
private Param param;
private Context ctx;
public NodeFilter(ColumnMetaData column, int priority, Node node, Context ctx) {
super(column, priority);
this.node = node;
this.exp = new Expression(node);
this.ctx = ctx;
param = ctx.getParam(column.getColName());
if (param == null) {
param = new Param(column.getColName(), Param.VAR, null);
ctx.addParam(param);
}
}
public boolean match(Object value) {
param.setValue(value);
return Variant.isTrue(node.calculate(ctx));
}
public boolean match(Object minValue, Object maxValue) {
if (Variant.isEquals(minValue, maxValue)) {
return match(minValue);
} else {
return true;
}
}
public Node getNode() {
return node;
}
public void setNode(Node node) {
this.node = node;
}
public Param getParam() {
return param;
}
public Context getCtx() {
return ctx;
}
}