com.zwares.base.util
Class TextParser

java.lang.Object
  |
  +--com.zwares.base.util.TextParser

public class TextParser
extends java.lang.Object

This class is used as a parser to parse a String to different data types / arrays.


Field Summary
static java.lang.String DELIM
           
 
Constructor Summary
TextParser()
           
 
Method Summary
static boolean toBoolean(java.lang.String s)
          Static method used to convert a string to a boolean value.
static double toDouble(java.lang.String s)
          Static method used to convert a string to a double value.
static double[] toDoubleArray(java.lang.String s)
          Static method used to convert a string to a double array using the default delimiter.
static double[] toDoubleArray(java.lang.String s, java.lang.String delimiter)
          Static method used to convert a string to a double array using the given delimiter.
static int toInt(java.lang.String s)
          Static method used to convert a string to an integer value.
static java.lang.String[] toStringArray(int[] ia)
          Static method used to convert an integer array to a string array.
static java.lang.String[] toStringArray(java.lang.String s)
          Static method used to convert a string to string array using the default delimiter.
static java.lang.String[] toStringArray(java.lang.String s, java.lang.String delimiter)
          Static method used to convert a string to string array using the given delimiter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIM

public static final java.lang.String DELIM
See Also:
Constant Field Values
Constructor Detail

TextParser

public TextParser()
Method Detail

toStringArray

public static java.lang.String[] toStringArray(java.lang.String s)
Static method used to convert a string to string array using the default delimiter.


toStringArray

public static java.lang.String[] toStringArray(java.lang.String s,
                                               java.lang.String delimiter)
Static method used to convert a string to string array using the given delimiter.


toStringArray

public static java.lang.String[] toStringArray(int[] ia)
Static method used to convert an integer array to a string array.


toDoubleArray

public static double[] toDoubleArray(java.lang.String s)
Static method used to convert a string to a double array using the default delimiter.


toDoubleArray

public static double[] toDoubleArray(java.lang.String s,
                                     java.lang.String delimiter)
Static method used to convert a string to a double array using the given delimiter.


toInt

public static int toInt(java.lang.String s)
Static method used to convert a string to an integer value.


toDouble

public static double toDouble(java.lang.String s)
Static method used to convert a string to a double value.


toBoolean

public static boolean toBoolean(java.lang.String s)
Static method used to convert a string to a boolean value.