|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.mop.Toolbox | +--net.sf.saffron.util.Util
Miscellaneous utility functions.
Nested Class Summary | |
static class |
Util.UtilTestCase
|
Nested classes inherited from class openjava.mop.Toolbox |
Toolbox.StopIterationException |
Field Summary | |
static PrintWriter |
debugWriter
|
static Object[] |
emptyObjectArray
|
static String[] |
emptyStringArray
|
static String |
fileSeparator
System-dependent file separator, for example, "/" or "\." |
static String |
lineSeparator
System-dependent newline character. |
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 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 int |
hash(int i,
int j)
|
(package private) static boolean |
isStatic(Member member)
|
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 nlogn(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 URL |
toURL(File file)
Creates a file-protocol URL for the given file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static String lineSeparator
public static String fileSeparator
public static PrintWriter debugWriter
public static final Object[] emptyObjectArray
public static final String[] emptyStringArray
Constructor Detail |
public Util()
Method Detail |
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 StatementList clone(StatementList e)
public static String[] clone(String[] a)
public static int[] clone(int[] a)
public static boolean equals(int[] a, int[] b)
public static int hash(int i, int j)
public static void main(String[] args) throws Exception
Exception
public static Set minus(Set set1, Set set2)
set1
but not in
set2
, without modifying either.
public static double nLogN(double d)
nlogn(n)
(or n
if n
is
small, so the result is never negative.
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 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 void println(PrintWriter pw, Object o)
public static final String replace(String s, String find, String replace)
find
in s
with
replace
.
public static URL toURL(File file) throws MalformedURLException
MalformedURLException
public static Expression clone(Expression exp)
public static Expression[] clone(Expression[] a)
public static String stripDoubleQuotes(String value)
"foo\"bar"
becomes foo"bar
.
public static Test suite() throws Exception
Exception
public static Object[] toArray(Vector v)
Vector.toArray()
on Java2
public static Object[] toArray(Vector v, Object[] a)
Vector.toArray(Object[])
.
static boolean isStatic(Member member)
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |