saffron.opt
Class Operand

java.lang.Object
  |
  +--saffron.opt.Operand
All Implemented Interfaces:
Walkable

public class Operand
extends Object
implements Walkable

An Operand determines whether a Rule 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  Operand[] children
           
private  Class clazz
           
private  CallingConvention convention
           
(package private) static Operand[] noOperands
           
(package private)  int ordinalInParent
           
(package private)  int ordinalInRule
           
(package private)  Operand parent
           
(package private)  Rule rule
           
(package private)  int[] solveOrder
           
 
Constructor Summary
Operand(Class clazz, CallingConvention convention, Operand[] children)
          Creates an operand which matches any CallingConvention.
Operand(Class clazz, Operand[] children)
          Creates an operand which matches any CallingConvention.
 
Method Summary
 Object[] getChildren()
          returns an array of the object's children.
 boolean matches(Rel 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

clazz

private final Class clazz

convention

private final CallingConvention convention

children

private final Operand[] children

parent

Operand parent

ordinalInParent

int ordinalInParent

rule

Rule rule

ordinalInRule

int ordinalInRule

solveOrder

int[] solveOrder

noOperands

static final Operand[] noOperands
Constructor Detail

Operand

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

Pre-condition:
clazz != null

Operand

public Operand(Class clazz,
               CallingConvention convention,
               Operand[] 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(Rel rel)
Returns whether a relational expression matches this operand. It must be of the right class and calling convention.


SourceForge.net_Logo