org.jorion.util
Class MiscUtils

java.lang.Object
  extended by org.jorion.util.MiscUtils

public final class MiscUtils
extends java.lang.Object

Set of miscellaneous static functions.

Author:
Bernard Jorion, www.jorion.org

Field Summary
static java.lang.String EXT_CLASS
          Extension for the class files.
static java.lang.String EXT_JAR
          Extension for the jar files.
 
Method Summary
static
<E> java.util.Vector<java.util.Vector<E>>
arrayToVectorOfVector(E[] a)
          Convert an array of E to a vector of vector of E.
static boolean parseArguments(java.lang.String[] args, java.lang.String[] allowedArgs, boolean noArgOk)
          Parse the given arguments and return false if one of them is not in the list of allowed args.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXT_JAR

public static final java.lang.String EXT_JAR
Extension for the jar files.

See Also:
Constant Field Values

EXT_CLASS

public static final java.lang.String EXT_CLASS
Extension for the class files.

See Also:
Constant Field Values
Method Detail

parseArguments

public static boolean parseArguments(java.lang.String[] args,
                                     java.lang.String[] allowedArgs,
                                     boolean noArgOk)
Parse the given arguments and return false if one of them is not in the list of allowed args. All the arguments must be prefixed with a dash ("-").

Parameters:
args - An array of arguments to check.
allowedArgs - An array of allowed arguments.
noArgOk - True if args may be empty.
Returns:
False if one of the arguments is not allowed, or if there is no argument and noArgOk is false. True otherwise.

arrayToVectorOfVector

public static <E> java.util.Vector<java.util.Vector<E>> arrayToVectorOfVector(E[] a)
Convert an array of E to a vector of vector of E. This is useful for one-column tables.

Type Parameters:
E - The array type.
Parameters:
a - The array to convert.
Returns:
A vector of vector of E.