Class OpFilter
- java.lang.Object
-
- org.apache.jena.sparql.util.PrintSerializableBase
-
- org.apache.jena.sparql.algebra.op.OpBase
-
- org.apache.jena.sparql.algebra.op.Op1
-
- org.apache.jena.sparql.algebra.op.OpFilter
-
- All Implemented Interfaces:
org.apache.jena.atlas.io.Printable
,Op
,Named
,PrintSerializable
public class OpFilter extends Op1
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Op
apply(Transform transform, Op subOp)
Op1
copy(Op subOp)
static OpFilter
ensureFilter(Op op)
Ensure that the algebra op is a filter.boolean
equalTo(Op other, NodeIsomorphismMap labelMap)
static Op
filter(Expr expr, Op op)
Add expression - mutates an existing filterstatic OpFilter
filterAlways(ExprList exprs, Op subOp)
Create a OpFilter with the expressions and subOp.static Op
filterBy(ExprList exprs, Op op)
Combine an ExprList with an Op so that the expressions filter the Op.static OpFilter
filterDirect(ExprList exprs, Op op)
Make a OpFilter - guaranteed to return an fresh OpFilterstatic OpFilter
filterDirect(Expr expr, Op op)
Make a OpFilter - guaranteed to return an fresh OpFilterExprList
getExprs()
java.lang.String
getName()
int
hashCode()
static OpFilter
tidy(OpFilter base)
Compress multiple filters: (filter (filter (filter op)))) into one (filter op)void
visit(OpVisitor opVisitor)
-
Methods inherited from class org.apache.jena.sparql.util.PrintSerializableBase
toString, toString
-
Methods inherited from interface org.apache.jena.sparql.util.PrintSerializable
toString
-
-
-
-
Method Detail
-
ensureFilter
public static OpFilter ensureFilter(Op op)
Ensure that the algebra op is a filter. If the input is a filter, just return that, else create a filter with no expressions and "this" as the subOp.- API Note:
- This operation assumes the caller is going to add expressions.
Filters without any expressions are discouraged.
Consider collecting the expressions together first and using
filterBy(org.apache.jena.sparql.expr.ExprList, org.apache.jena.sparql.algebra.Op)
.
-
filterBy
public static Op filterBy(ExprList exprs, Op op)
Combine an ExprList with an Op so that the expressions filter the Op. If the exprs are empty, return the Op. If the op is already a OpFilter, merge the expressions into the filters existing expressions. Else create a new OpFilter with the expressions and subOp.
-
filterAlways
public static OpFilter filterAlways(ExprList exprs, Op subOp)
Create a OpFilter with the expressions and subOp. If subOp is a filter, combine expressions (de-layer).
-
filterDirect
public static OpFilter filterDirect(ExprList exprs, Op op)
Make a OpFilter - guaranteed to return an fresh OpFilter
-
filterDirect
public static OpFilter filterDirect(Expr expr, Op op)
Make a OpFilter - guaranteed to return an fresh OpFilter
-
tidy
public static OpFilter tidy(OpFilter base)
Compress multiple filters: (filter (filter (filter op)))) into one (filter op)
-
getExprs
public ExprList getExprs()
-
getName
public java.lang.String getName()
-
visit
public void visit(OpVisitor opVisitor)
-
-