Class SpatialIndexer


public class SpatialIndexer extends RealizedExpressionJoinIndexer

JoinIndexer implementation that attempts to build an in-memory spatial index of the tuples for narrowing down the set of rhs tuples.

  • Field Details

  • Constructor Details

    • SpatialIndexer

      public SpatialIndexer(nz.org.riskscape.engine.join.Join join, nz.org.riskscape.engine.relation.TupleIterator rhs, nz.org.riskscape.engine.rl.ExpressionRealizer expressionRealizer)
    • SpatialIndexer

      public SpatialIndexer(nz.org.riskscape.engine.join.Join join, nz.org.riskscape.engine.rl.ExpressionRealizer expressionRealizer)
  • Method Details

    • isUsable

      public boolean isUsable()
      Overrides:
      isUsable in class RealizedExpressionJoinIndexer
      Returns:
      true if this join can be used, e.g. it's suitable for the query and join. This is intended as a simpler way of providing a set of implementations such that the DefaultJoiner can work through which ones are appropriate by checking this method.
    • isAllowed

      protected boolean isAllowed(nz.org.riskscape.engine.rl.RealizedExpression childFilter)
      Description copied from class: RealizedExpressionJoinIndexer

      Validates that RealizedExpression is able to be used for indexing.

      The minimum requirement is the expression must return boolean.

      Overrides:
      isAllowed in class RealizedExpressionJoinIndexer
      Parameters:
      childFilter - to check
      Returns:
      true if expression can be applied to this indexer
    • createRhsIterator

      public nz.org.riskscape.engine.relation.TupleIterator createRhsIterator(nz.org.riskscape.engine.Tuple lhs)
      Description copied from class: JoinIndexer

      Create a TupleIterator that will contain at least the set of Tuples that are needed to completely join the lhs to the rhs based on the join.

      Specified by:
      createRhsIterator in class JoinIndexer
    • addToIndex

      public void addToIndex(nz.org.riskscape.engine.Tuple toCache)
      Specified by:
      addToIndex in class JoinIndexer
    • toString

      public String toString()
      Overrides:
      toString in class Object