The Encog Project

org.encog.util.math
Class Convert

java.lang.Object
  extended by org.encog.util.math.Convert

public final class Convert
extends java.lang.Object

This class is used to convert strings into numeric values. If the string holds a non-numeric value, a zero is returned.

Author:
jheaton

Method Summary
static double string2double(java.lang.String str)
          Convert a string to a double.
static int string2int(java.lang.String str)
          Convert a string to an int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

string2double

public static double string2double(java.lang.String str)
Convert a string to a double. Just make the number a zero if the string is invalid.

Parameters:
str - The string.
Returns:
The string converted to numeric.

string2int

public static int string2int(java.lang.String str)
Convert a string to an int. Just make the number a zero if the string is invalid.

Parameters:
str - The string.
Returns:
The string converted to numeric.

The Encog Project