net.sf.saffron.opt
Class RuleOperand

java.lang.Object
  |
  +--net.sf.saffron.opt.RuleOperand
All Implemented Interfaces:
Walkable

public class RuleOperand
extends Object
implements Walkable

A RuleOperand determines whether a VolcanoRule can be applied to a particular expression.

For example, the rule to pull a filter up from the left side of a join takes operands: (Join (Filter) (Any)).

Note that children means different things if it is empty or it is null: (Join (Filter ()) (Any)) means that, to match the rule, Filter must have no operands.


Field Summary
private  RuleOperand[] children
           
private  Class clazz
           
private  CallingConvention convention
           
(package private) static RuleOperand[] noOperands
           
(package private)  int ordinalInParent
           
(package private)  int ordinalInRule
           
(package private)  RuleOperand parent
           
(package private)  VolcanoRule rule
           
(package private)  int[] solveOrder
           
 
Constructor Summary
RuleOperand(Class clazz, CallingConvention convention, RuleOperand[] children)
          Creates an operand which matches any CallingConvention.
RuleOperand(Class clazz, RuleOperand[] children)
          Creates an operand which matches any CallingConvention.
 
Method Summary
 Object[] getChildren()
          returns an array of the object's children.
 boolean matches(SaffronRel rel)
          Returns whether a relational expression matches this operand.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noOperands

static final RuleOperand[] noOperands

parent

RuleOperand parent

rule

VolcanoRule rule

solveOrder

int[] solveOrder

ordinalInParent

int ordinalInParent

ordinalInRule

int ordinalInRule

convention

private final CallingConvention convention

clazz

private final Class clazz

children

private final RuleOperand[] children
Constructor Detail

RuleOperand

public RuleOperand(Class clazz,
                   RuleOperand[] children)
Creates an operand which matches any CallingConvention.

Pre-condition:
clazz != null

RuleOperand

public RuleOperand(Class clazz,
                   CallingConvention convention,
                   RuleOperand[] children)
Creates an operand which matches any CallingConvention.

Pre-condition:
clazz != null
Method Detail

getChildren

public Object[] getChildren()
Description copied from interface: Walkable
returns an array of the object's children. Those which are not Walkable are ignored.

Specified by:
getChildren in interface Walkable

matches

public boolean matches(SaffronRel rel)
Returns whether a relational expression matches this operand. It must be of the right class and calling convention.


SourceForge.net_Logo