ptolemy.hsif
Class HSIFUtilities

java.lang.Object
  extended by ptolemy.hsif.HSIFUtilities

public class HSIFUtilities
extends java.lang.Object

Utilities methods for operating on HSIF files. These methods are in a separate non-graphical class so that we can test them as part of the nightly build, or provide non-graphical tools that use these methods

Since:
Ptolemy II 2.2
Version:
$Id: HSIFUtilities.java 47482 2007-12-06 18:33:55Z cxh $
Author:
Christopher Hylands
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (eal)

Constructor Summary
private HSIFUtilities()
          Instances of this class cannot be created.
 
Method Summary
static void HSIFToMoML(java.lang.String input, java.io.FileWriter fileWriter)
          Read in an HSIF file, transform it into MoML and write the output to a FileWriter.
static void HSIFToMoML(java.lang.String input, java.lang.String output)
          Read in an HSIF file, transform it into MoML and generate an output file.
static void main(java.lang.String[] args)
          Convert the first argument from a HSIF file into a MoML file named by the second argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HSIFUtilities

private HSIFUtilities()
Instances of this class cannot be created.

Method Detail

HSIFToMoML

public static void HSIFToMoML(java.lang.String input,
                              java.io.FileWriter fileWriter)
                       throws java.lang.Exception
Read in an HSIF file, transform it into MoML and write the output to a FileWriter.

Parameters:
input - HSIF file to be read in.
fileWriter - A FileWriter that will write to the MoML file.
Throws:
java.lang.Exception - If there is a problem with the transformation.

HSIFToMoML

public static void HSIFToMoML(java.lang.String input,
                              java.lang.String output)
                       throws java.lang.Exception
Read in an HSIF file, transform it into MoML and generate an output file. Note that if the output file exists, then it is overwritten.

Parameters:
input - HSIF file to be read in
output - The MoMLFile to be generated.
Throws:
java.lang.Exception - If there is a problem with the transformation.

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Convert the first argument from a HSIF file into a MoML file named by the second argument. For example
  java -classpath $PTII ptolemy.hsif.HSIFUtilities \
       $PTII/ptolemy/hsif/demo/SwimmingPool/SwimmingPool.xml \
       /tmp/SwimmingPool_moml.xml
  
will read in SwimmingPool.xml and create SwimmingPool_moml.xml

Parameters:
args - An array of Strings. The first element should name a HSIF file to read in, the second should name the MoML file to be generated.
Throws:
java.lang.Exception - If the conversion fails.