|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.Toolbox | +--saffron.util.Util
Miscellaneous utility functions.
Nested Class Summary | |
private static class |
Util.RelHolder
|
static class |
Util.UtilTestCase
|
private static class |
Util.VariableSetVisitor
|
private static class |
Util.VariableUsedVisitor
|
Nested classes inherited from class openjava.mop.Toolbox |
Toolbox.StopIterationException |
Field Summary | |
static PrintWriter |
debugWriter
|
static Expression[] |
emptyExpressionArray
|
static Object[] |
emptyObjectArray
|
static String[] |
emptyStringArray
|
static String |
fileSeparator
System-dependent file separator, for example, "/" or "\." |
static String |
lineSeparator
System-dependent newline character. |
static ThreadLocal |
threadDeclarers
Each thread's enclosing OJClass . |
Fields inherited from class openjava.mop.Toolbox |
clazzAggAndAcc, clazzAggregationExtender, clazzClass, clazzCollection, clazzComparable, clazzComparator, clazzConnection, clazzEntry, clazzEnumeration, clazzHashtable, clazzIterable, clazzIterator, clazzMap, clazzMapEntry, clazzObject, clazzObjectArray, clazzResultSet, clazzSaffronUtil, clazzSet, clazzSQLException, clazzString, clazzSyntheticObject, clazzVector, clazzVoid, emptyArrayOfOJClass |
Constructor Summary | |
Util()
|
Method Summary | |
static Expression |
clone(Expression exp)
|
static Expression[] |
clone(Expression[] a)
|
static int[] |
clone(int[] a)
|
static Rel |
clone(Rel rel)
|
static Rel[] |
clone(Rel[] rels)
|
static StatementList |
clone(StatementList e)
|
static String[] |
clone(String[] a)
|
static void |
discard(int i)
|
static void |
discard(Object o)
|
static boolean |
equal(String s0,
String s1)
Returns whether two strings are equal or are both null. |
static boolean |
equals(int[] a,
int[] b)
Returns whether two integer arrays are equal. |
static Object |
evaluate(Expression exp)
|
static void |
evaluate(Expression[] exps,
Object[] results)
|
static boolean |
evaluateBoolean(Expression exp)
|
static OJClass |
getExecutableClass(OJClass clazz)
|
static OJField |
getExecutableField(OJField field)
|
static double |
getSelectivity(Expression exp)
|
static UnboundVariableCollector |
getUnboundVariables(Rel rel)
Returns a description of what variables are unbound inside rel . |
static Set |
getVariablesSet(Rel rel)
Returns a list of variables set by a relational expression or its descendants. |
static String[] |
getVariablesSetAndUsed(Rel rel0,
Rel rel1)
Returns a set of distinct variables set by rel0 and used by
rel1 . |
static Set |
getVariablesUsed(Rel rel)
Returns a list of variables used by a relational expression or its descendants. |
static Rel |
go(RelVisitor visitor,
Rel p)
Sets a RelVisitor going on a given relational expression,
and returns the result. |
static int |
hash(int i,
int j)
|
(package private) static boolean |
isStatic(Member member)
|
static OJClass |
leastRestrictiveClass(OJClass clazz1,
OJClass clazz2)
|
static void |
main(String[] args)
Runs the test suite. |
static Set |
minus(Set set1,
Set set2)
Return a set of the elements which are in set1 but not
in set2 , without modifying either. |
static double |
nLogN(double d)
Computes n * logn(n) (or n if n
is small, so the result is never negative. |
static void |
print(PrintWriter pw,
Object o)
Print an object using reflection. |
static void |
print(PrintWriter pw,
Object o,
int indent)
|
static void |
printJavaString(PrintWriter pw,
String s,
boolean nullMeansNull)
Prints a string, enclosing in double quotes (") and escaping if necessary. |
static void |
println(PrintWriter pw,
Object o)
|
static String |
replace(String s,
String find,
String replace)
Replaces every occurrence of find in s with
replace . |
static String |
stripDoubleQuotes(String value)
Converts double-quoted Java strings to their contents. |
static Test |
suite()
|
static Object[] |
toArray(Vector v)
Deprecated. use Vector.toArray() on Java2 |
static Object[] |
toArray(Vector v,
Object[] a)
Equivalent to Vector.toArray(Object[]) . |
static OJClass |
toOJClass(OJClass declarer,
Type rowType)
|
static OJClass |
toOJClass(Type rowType)
Converts a Type to a OJClass . |
static String |
toString(Rel[] a)
|
static Type |
toType(TypeFactory typeFactory,
OJClass ojClass)
|
static Type[] |
toTypeArray(TypeFactory typeFactory,
OJClass[] classes)
|
static TypeName |
toTypeName(Type rowType)
Converts a Type to a TypeName . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final ThreadLocal threadDeclarers
OJClass
. Synthetic classes are declared
as inner classes of this.
public static String lineSeparator
public static String fileSeparator
public static PrintWriter debugWriter
public static final Object[] emptyObjectArray
public static final String[] emptyStringArray
public static final Expression[] emptyExpressionArray
Constructor Detail |
public Util()
Method Detail |
public static void main(String[] args) throws Exception
Exception
public static void print(PrintWriter pw, Object o)
null
;
arrays of objects and primitive values; for regular objects, we print
all public fields.
public static void println(PrintWriter pw, Object o)
public static void print(PrintWriter pw, Object o, int indent)
public static final void printJavaString(PrintWriter pw, String s, boolean nullMeansNull)
printDoubleQuoted(w,"x\"y",false)
prints "x\"y"
.
public static String stripDoubleQuotes(String value)
"foo\"bar"
becomes foo"bar
.
public static final String replace(String s, String find, String replace)
find
in s
with
replace
.
public static final void discard(Object o)
public static final void discard(int i)
public static final boolean equal(String s0, String s1)
public static Rel clone(Rel rel)
public static Rel[] clone(Rel[] rels)
public static Expression clone(Expression exp)
public static Expression[] clone(Expression[] a)
public static String[] clone(String[] a)
public static StatementList clone(StatementList e)
public static String toString(Rel[] a)
static boolean isStatic(Member member)
public static int[] clone(int[] a)
public static int hash(int i, int j)
public static OJClass getExecutableClass(OJClass clazz)
public static OJField getExecutableField(OJField field)
public static Object evaluate(Expression exp)
public static void evaluate(Expression[] exps, Object[] results)
public static boolean evaluateBoolean(Expression exp)
public static double getSelectivity(Expression exp)
public static Object[] toArray(Vector v)
Vector.toArray()
on Java2
public static Object[] toArray(Vector v, Object[] a)
Vector.toArray(Object[])
.
public static boolean equals(int[] a, int[] b)
public static Set getVariablesSet(Rel rel)
public static Set getVariablesUsed(Rel rel)
public static String[] getVariablesSetAndUsed(Rel rel0, Rel rel1)
rel0
and used by
rel1
.
public static Rel go(RelVisitor visitor, Rel p)
RelVisitor
going on a given relational expression,
and returns the result.
public static OJClass leastRestrictiveClass(OJClass clazz1, OJClass clazz2)
public static UnboundVariableCollector getUnboundVariables(Rel rel)
rel
.
public static double nLogN(double d)
n * logn(n)
(or n
if n
is small, so the result is never negative.
public static Test suite() throws Exception
Exception
public static Set minus(Set set1, Set set2)
set1
but not
in set2
, without modifying either.
public static Type toType(TypeFactory typeFactory, OJClass ojClass)
public static OJClass toOJClass(OJClass declarer, Type rowType)
public static OJClass toOJClass(Type rowType)
Type
to a OJClass
.
public static TypeName toTypeName(Type rowType)
Type
to a TypeName
.
public static Type[] toTypeArray(TypeFactory typeFactory, OJClass[] classes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |