edu.bonn.cs.iv.bonnmotion
Class App

java.lang.Object
  extended by edu.bonn.cs.iv.bonnmotion.App
Direct Known Subclasses:
Cut, GlomoFile, LinkDump, NSFile, Scenario, SPPXml, Statistics, Visplot

public abstract class App
extends java.lang.Object

Base class for all applications and all scenario generators.


Constructor Summary
App()
           
 
Method Summary
static void exceptionHandler(java.lang.String _msg, java.lang.Exception _e)
          Tries to catch all exceptions and to display them in a user friendly manner.
abstract  void go(java.lang.String[] args)
          Main method from where all the magic starts ...
static java.io.PrintWriter openPrintWriter(java.lang.String filename)
          Writes the scenario data to a file.
protected  void parse(java.lang.String[] args)
           
protected  boolean parseArg(char key, java.lang.String val)
           
protected  boolean parseArg(java.lang.String a)
           
static double[] parseDoubleArray(java.lang.String arg)
          Converts a String to a double array.
static int[] parseIntArray(java.lang.String arg)
          Converts a String to an int array.
static java.lang.String[] parseStringArray(java.lang.String arg)
          Converts a String to a String array.
static void printHelp()
           
static java.lang.String[] stringArrayConcat(java.lang.String[] a, java.lang.String[] b)
          Concatenates two string arrays
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

App

public App()
Method Detail

parse

protected void parse(java.lang.String[] args)

parseArg

protected boolean parseArg(java.lang.String a)

parseArg

protected boolean parseArg(char key,
                           java.lang.String val)

exceptionHandler

public static void exceptionHandler(java.lang.String _msg,
                                    java.lang.Exception _e)
Tries to catch all exceptions and to display them in a user friendly manner.

Parameters:
_msg - a user defined msg (e.a. the place where the exceptions occurs)
_e - the Exception

go

public abstract void go(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Main method from where all the magic starts ...

Throws:
java.io.FileNotFoundException
java.io.IOException

openPrintWriter

public static java.io.PrintWriter openPrintWriter(java.lang.String filename)
Writes the scenario data to a file.

Parameters:
filename - Filename

parseIntArray

public static int[] parseIntArray(java.lang.String arg)
Converts a String to an int array.

Returns:
new int array

parseDoubleArray

public static double[] parseDoubleArray(java.lang.String arg)
Converts a String to a double array.

Returns:
new double array

parseStringArray

public static java.lang.String[] parseStringArray(java.lang.String arg)
Converts a String to a String array.

Returns:
new double array

printHelp

public static void printHelp()

stringArrayConcat

public static java.lang.String[] stringArrayConcat(java.lang.String[] a,
                                                   java.lang.String[] b)
Concatenates two string arrays

Parameters:
a - first array
b - first array
Returns:
new and concated string array