org.montsuqi.util
Class ParameterConverter

java.lang.Object
  extended by org.montsuqi.util.ParameterConverter

public class ParameterConverter
extends java.lang.Object

An utility class for converting string to other types.


Method Summary
static boolean toBoolean(java.lang.String s)
          Converts the given string into boolean.
 double toDouble(java.lang.String s)
          Converts the given string into double.
static int toInteger(java.lang.String s)
          Converts the given string into integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toInteger

public static int toInteger(java.lang.String s)

Converts the given string into integer.

Parameters:
s - the string to convert.

toBoolean

public static boolean toBoolean(java.lang.String s)

Converts the given string into boolean.

Parameters:
s - the string to convert.
Returns:
true for strings which starts with 't', 'y', 'T' or 'Y'. false for strings which starts with 'f', 'n', 'F' or 'N'. Otherwise the string is converted to integer and returns true if it is not zero, false if it is zero.

toDouble

public double toDouble(java.lang.String s)

Converts the given string into double.

Parameters:
s - the string to convert.