at.dms.compiler.tools.common
Class Utils

java.lang.Object
  extended by at.dms.compiler.tools.common.Utils
Direct Known Subclasses:
Utils

public abstract class Utils
extends Object

This class defines severals utilities methods used in source code


Constructor Summary
Utils()
           
 
Method Summary
static void kopi_assert(boolean b)
          Check if an assertion is valid
static String[] splitQualifiedName(String name)
          Splits a string like: "java/lang/System/out" into two strings: "java/lang/System" and "out"
static String[] splitQualifiedName(String name, char separator)
          Splits a string like: "java/lang/System/out" into two strings: "java/lang/System" and "out"
static Object[] toArray(Vector vect, Class type)
          Creates a typed array from a vector.
static int[] toIntArray(Vector vect)
          Creates a int array from a vector.
static Vector<Object> toVector(Object[] array)
          Creates a vector and fills it with the elements of the specified array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

kopi_assert

public static final void kopi_assert(boolean b)
Check if an assertion is valid

Throws:
RuntimeException - the entire token reference

toVector

public static Vector<Object> toVector(Object[] array)
Creates a vector and fills it with the elements of the specified array.

Parameters:
array - the array of elements

toArray

public static Object[] toArray(Vector vect,
                               Class type)
Creates a typed array from a vector.

Parameters:
vect - the vector containing the elements
type - the type of the elements

toIntArray

public static int[] toIntArray(Vector vect)
Creates a int array from a vector.

Parameters:
vect - the vector containing the elements

splitQualifiedName

public static String[] splitQualifiedName(String name,
                                          char separator)
Splits a string like: "java/lang/System/out" into two strings: "java/lang/System" and "out"


splitQualifiedName

public static String[] splitQualifiedName(String name)
Splits a string like: "java/lang/System/out" into two strings: "java/lang/System" and "out"