org.jscience.biology.lsystems.growing
Class Converter

java.lang.Object
  extended by org.jscience.biology.lsystems.growing.Converter

public class Converter
extends java.lang.Object

This class holds methods for easier conversion of types.


Constructor Summary
Converter()
           
 
Method Summary
static java.lang.String getStringBehind(java.lang.String strMain, java.lang.String strSub)
          Gets the string behind a separator.
static float readFloat(java.lang.String strNumber)
          Extracts the float value from a string.
static int readInt(java.lang.String strNumber)
          Extracts the value from the string and converts it to an integer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Converter

public Converter()
Method Detail

readInt

public static int readInt(java.lang.String strNumber)
Extracts the value from the string and converts it to an integer

Parameters:
strNumber - The the string value.
Returns:
The integer value from the string. zero if an error occured.

readFloat

public static float readFloat(java.lang.String strNumber)
Extracts the float value from a string.

Parameters:
strNumber - The string with the float value.
Returns:
The float value. zero of an error occured.

getStringBehind

public static java.lang.String getStringBehind(java.lang.String strMain,
                                               java.lang.String strSub)
                                        throws java.lang.Exception
Gets the string behind a separator. This is the string from the separator to the end of the line.

Parameters:
strMain - The string containing the separator.
strSub - DOCUMENT ME!
Returns:
The string behind the separator.
Throws:
java.lang.Exception - An exception in thrown if no separator can be found.