Class RealizedExpressionJoinIndexer

java.lang.Object
nz.org.riskscape.engine.join.JoinIndexer
nz.org.riskscape.engine.join.RealizedExpressionJoinIndexer
Direct Known Subclasses:
HashIndexer, SpatialIndexer

public abstract class RealizedExpressionJoinIndexer extends JoinIndexer

Abstract JoinIndexer for creating indexers that perform some kind of comparison with a boolean yielding RealizedExpression. Most likely lhs-rhs comparison of some kind.

  • Field Details

    • lhsExpression

      protected nz.org.riskscape.engine.rl.RealizedExpression lhsExpression

      Yields the lhs value of the join condition - used for querying the index once built

    • rhsExpression

      protected nz.org.riskscape.engine.rl.RealizedExpression rhsExpression

      Expression yielding the rhs value - this will be the indexed object

    • operator

      protected nz.org.riskscape.engine.rl.RealizedExpression operator

      The comparison operator between lhs and rhs.

  • Constructor Details

    • RealizedExpressionJoinIndexer

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

    • isAllowed

      protected boolean isAllowed(nz.org.riskscape.engine.rl.RealizedExpression expression)

      Validates that RealizedExpression is able to be used for indexing.

      The minimum requirement is the expression must return boolean.

      Parameters:
      expression - to check
      Returns:
      true if expression can be applied to this indexer
    • isUsable

      public boolean isUsable()
      Specified by:
      isUsable in class JoinIndexer
      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.
    • processIndexableMetadata

      protected final void processIndexableMetadata()

      Inspects the JoinCondition to determine if it is suitable for indexing.

      If it is then the lhs and rhs Expressions will be set.