|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.misc.Utility
public class Utility
This class contains static utility functions that have no other logical place to go. Its existence is horribly un-object-y and all that, but so is java.lang.Math.
Field Summary | |
---|---|
private static java.lang.String[] |
CONSONANT
|
private static java.lang.String[] |
PATTERN
|
static java.util.Random |
rnd
|
private static java.lang.String[] |
VOWEL
|
Constructor Summary | |
---|---|
Utility()
|
Method Summary | |
---|---|
static double[] |
joinDoubleArrays(double[] a,
double[] b)
Joins two arrays of doubles together into a new array. |
static int[] |
joinIntArrays(int[] a,
int[] b)
Joins two arrays of ints together into a new array. |
static java.lang.String |
listString(java.lang.Object[] array)
Pretty-prints an array of objects so that they're separated by ", " substrings. |
static java.lang.String |
randomName()
Creates an artificial name for data generation. |
static java.lang.String |
readFile(java.lang.String path)
Reads the contents of an entire text file into a single string. |
static java.lang.String |
sqlString(java.lang.String str)
Prepares a String for use in a SQL query by escaping characters as necessary
and adding single quotes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Random rnd
private static final java.lang.String[] CONSONANT
private static final java.lang.String[] VOWEL
private static final java.lang.String[] PATTERN
Constructor Detail |
---|
public Utility()
Method Detail |
---|
public static double[] joinDoubleArrays(double[] a, double[] b)
a
- the first arrayb
- the second array
public static int[] joinIntArrays(int[] a, int[] b)
a
- the first arrayb
- the second array
public static java.lang.String listString(java.lang.Object[] array)
array
- the input array
public static java.lang.String randomName()
public static java.lang.String readFile(java.lang.String path)
path
- the file to read
public static java.lang.String sqlString(java.lang.String str)
String
for use in a SQL query by escaping characters as necessary
and adding single quotes.
str
- the string to wrap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |