Class OpFilter

All Implemented Interfaces:
org.apache.jena.atlas.io.Printable, Op, Named, PrintSerializable

public class OpFilter extends Op1
  • Method Details

    • filter

      public static Op filter(Expr expr, Op op)
      Add expression - mutates an existing filter
    • 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 String getName()
    • apply

      public Op apply(Transform transform, Op subOp)
      Specified by:
      apply in class Op1
    • visit

      public void visit(OpVisitor opVisitor)
    • copy

      public Op1 copy(Op subOp)
      Specified by:
      copy in class Op1
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class OpBase
    • equalTo

      public boolean equalTo(Op other, NodeIsomorphismMap labelMap)
      Specified by:
      equalTo in interface Op
      Specified by:
      equalTo in class OpBase