Spirograph
Class SpiroUtils

java.lang.Object
  |
  +--Spirograph.SpiroUtils

public abstract class SpiroUtils
extends java.lang.Object

This class contained a bunch of Utilities that were specific to this problem set, but only one of them turned out to be neccesary.

Copyright (c) 1998 Massachusetts Institute of Technology

See Also:
Accelerator

Field Summary
static int CUR
           
 
Constructor Summary
SpiroUtils()
           
 
Method Summary
static void copyFiles(java.lang.String src, java.lang.String dest)
           
static Accelerator createAccel(java.lang.String className)
          This method reads in a file, creates an Object from that class and casts it to an Accelerator.
static void delFile(java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUR

public static int CUR
Constructor Detail

SpiroUtils

public SpiroUtils()
Method Detail

delFile

public static void delFile(java.lang.String fileName)

copyFiles

public static void copyFiles(java.lang.String src,
                             java.lang.String dest)

createAccel

public static Accelerator createAccel(java.lang.String className)
This method reads in a file, creates an Object from that class and casts it to an Accelerator.

Class.forName(String) caches names, if I ask it to reread a file that the user has changed it will return the old version of that file. Therefore, I use some system calls to copy the file to a new name, read it in and erase it.

This method is only used to load the classes, if any, specified as command line arguments when the program is started. It is not used to load the classes that are compiled during the execution of the program. To do this, a cs101.util.MultiClassLoader is used.

See Also:
cs101.util.MultiClassLoader