|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.gesture.util.Misc
Various useful things that didn't fit elsewhere
Inner Class Summary | |
static interface |
Misc.Acceptor
|
static interface |
Misc.MapAcceptor
|
static interface |
Misc.UnaryOperator
|
Field Summary | |
static Misc.UnaryOperator |
IDENTITY_OPERATOR
|
Method Summary | |
static Collection |
accept(Collection in,
Misc.Acceptor acceptor)
Return a Collection that contains all elements of in for which acceptor returns true. |
static boolean |
areEqualOrNull(String a,
String b)
returns true if both a and b are null, or if both have the same string value (as determined by equals()) |
static void |
bitStringTest(String[] args)
|
static Collection |
cloneCollection(Collection c)
Clones the collection. |
static Collection |
cloneCollection(Collection c,
boolean cloneMembers)
If cloneMembers, clone the members of the collection if possible. |
static Collection |
deepCopy(Collection c)
make a deep copy of c, as far as possible. |
static Map |
deepCopy(Map m)
|
static Map |
deepCopy(Map m,
Misc.MapAcceptor acceptor)
deep copy only key/value pairs that are accepted by acceptor |
static Object |
deepCopy(Object obj)
|
static Object[] |
deepCopy(Object[] a)
make a deep copy of a, as far as possible. |
static String |
escapeString(String s)
|
static Object |
findLargest(Collection collection,
Comparator comp)
|
static Object |
findLargest(Iterator iter,
Comparator comp)
|
static int |
indexOf(Object[] array,
Object target)
|
static Object |
invokeClone(Object o)
Invoke the clone() method and return the result, or null if it fails. |
static void |
main(String[] args)
|
static Collection |
makeEmptyClone(Collection c)
Return an empty collection of the same type as c, if possible (using Class.newInstance()). |
static Collection |
mapcar(Collection in,
Misc.UnaryOperator op)
Apply op to all elements of in, and make a new Collection of the results. |
static List |
mapcar(Iterator iter,
Misc.UnaryOperator op)
|
static int |
maxAbsIndex(Number[] a)
Return the index of the highest absolute value (or -1 if a has no elements). |
static int |
maxIndex(Number[] a)
Return the index of the highest value (or -1 if a has no elements). |
static BitSet |
not(BitSet bs)
|
static String |
ordinal(int n)
|
static String |
ordinalSuffix(int n)
|
static void |
printVector(PrintStream out,
double[] v,
int sigFigs)
|
static Double[] |
promoteArray(double[] a)
|
static Double[][] |
promoteMatrix(double[][] m)
|
static String |
readEscapedString(Reader reader)
|
static String |
readEscapedString(Reader reader,
boolean ignoreInitialWhitespace)
|
static int |
sgn(double d)
|
static void |
shuffle(int[] a)
|
static void |
shuffle(int[] a,
Random r)
|
static void |
shuffle(Object[] a)
|
static void |
shuffle(Object[] a,
Random r)
|
static void |
shuffle(Vector v)
|
static void |
shuffle(Vector v,
Random r)
|
static int |
sign(double x)
return -1 if x is negative, 0 if x is 0, or 1 if x is positive |
static String |
toString(double x,
int sigFigs)
I couldn't find a routine to correctly convert a double to a string with a specified number of significant figures, so I wrote one myself. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Misc.UnaryOperator IDENTITY_OPERATOR
Method Detail |
public static String toString(double x, int sigFigs)
public static Double[] promoteArray(double[] a)
public static Double[][] promoteMatrix(double[][] m)
public static int maxIndex(Number[] a)
public static int maxAbsIndex(Number[] a)
public static int sgn(double d)
public static BitSet not(BitSet bs)
public static void shuffle(int[] a)
public static void shuffle(int[] a, Random r)
public static void shuffle(Object[] a)
public static void shuffle(Object[] a, Random r)
public static void shuffle(Vector v)
public static void shuffle(Vector v, Random r)
public static void bitStringTest(String[] args)
public static void main(String[] args)
public static String ordinalSuffix(int n)
public static String ordinal(int n)
public static void printVector(PrintStream out, double[] v, int sigFigs)
public static int indexOf(Object[] array, Object target)
public static Object findLargest(Collection collection, Comparator comp)
public static Object findLargest(Iterator iter, Comparator comp)
public static Collection makeEmptyClone(Collection c)
public static Collection mapcar(Collection in, Misc.UnaryOperator op)
public static List mapcar(Iterator iter, Misc.UnaryOperator op)
public static Collection accept(Collection in, Misc.Acceptor acceptor)
public static Collection cloneCollection(Collection c)
public static Object invokeClone(Object o)
public static Collection cloneCollection(Collection c, boolean cloneMembers)
public static Object[] deepCopy(Object[] a)
public static Collection deepCopy(Collection c)
public static Object deepCopy(Object obj)
public static Map deepCopy(Map m)
public static Map deepCopy(Map m, Misc.MapAcceptor acceptor)
public static String escapeString(String s)
public static String readEscapedString(Reader reader) throws ParseException, IOException
public static String readEscapedString(Reader reader, boolean ignoreInitialWhitespace) throws ParseException, IOException
public static boolean areEqualOrNull(String a, String b)
public static int sign(double x)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |