|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saffron.opt.OptUtil
OptUtil
defines static utility methods for use in optimizing
SaffronRel
s.
Nested Class Summary | |
private static class |
OptUtil.RelHolder
|
private static class |
OptUtil.VariableSetVisitor
|
private static class |
OptUtil.VariableUsedVisitor
|
Field Summary | |
private static Variable |
var0
|
private static Variable |
var1
|
Constructor Summary | |
OptUtil()
|
Method Summary | |
static SaffronRel |
clone(SaffronRel rel)
|
static SaffronRel[] |
clone(SaffronRel[] rels)
|
static int |
getInputOrdinal(String name)
Returns the ordinal of the input represented by the variable name , or -1 if it does not represent an input. |
static Set |
getVariablesSet(SaffronRel rel)
Returns a list of variables set by a relational expression or its descendants. |
static String[] |
getVariablesSetAndUsed(SaffronRel rel0,
SaffronRel rel1)
Returns a set of distinct variables set by rel0 and used
by rel1 . |
static Set |
getVariablesUsed(SaffronRel rel)
Returns a list of variables used by a relational expression or its descendants. |
static SaffronRel |
go(RelVisitor visitor,
SaffronRel p)
Sets a RelVisitor going on a given relational expression, and
returns the result. |
static FieldAccess |
makeFieldAccess(Expression expr,
int field)
Constructs a reference to the field th field of
an expression. |
static Expression |
makeFieldAccess(Expression expr,
String fieldName)
Constructs a reference to a named field of an expression. |
static FieldAccess |
makeFieldAccess(int ordinal,
int field)
Constructs a reference to the field th field of
the ordinal th input. |
static String |
makeName(int ordinal)
Constructs the name for the ordinal th input. |
static Variable |
makeReference(int ordinal)
|
static String |
toString(SaffronRel[] a)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final Variable var0
private static final Variable var1
Constructor Detail |
public OptUtil()
Method Detail |
public static int getInputOrdinal(String name)
name
, or -1 if it does not represent an input.
public static Set getVariablesSet(SaffronRel rel)
public static String[] getVariablesSetAndUsed(SaffronRel rel0, SaffronRel rel1)
rel0
and used
by rel1
.
public static Set getVariablesUsed(SaffronRel rel)
public static SaffronRel clone(SaffronRel rel)
public static SaffronRel[] clone(SaffronRel[] rels)
public static SaffronRel go(RelVisitor visitor, SaffronRel p)
RelVisitor
going on a given relational expression, and
returns the result.
public static FieldAccess makeFieldAccess(int ordinal, int field)
field
th field of
the ordinal
th input.
public static FieldAccess makeFieldAccess(Expression expr, int field)
field
th field of
an expression.
public static Expression makeFieldAccess(Expression expr, String fieldName)
public static String makeName(int ordinal)
ordinal
th input. For example,
makeName(0)
returns "$input0".
public static Variable makeReference(int ordinal)
public static String toString(SaffronRel[] a)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |