com.simba.dsi.utilities
Class StringConverter

java.lang.Object
  extended by com.simba.dsi.utilities.StringConverter

Deprecated.

@Deprecated
public class StringConverter
extends java.lang.Object

Class that Convert String to Date, Time and Timestamp. This class is deprecated. CharConverter provides similar functionality.


Field Summary
static int[] s_fractionalMultiplier
          Deprecated. The number to multiply the parsed fraction by in parseTimestamp().
 
Constructor Summary
StringConverter()
          Deprecated.  
 
Method Summary
static java.sql.Date parseDate(java.lang.String dateStr, java.util.GregorianCalendar calendar)
          Deprecated. Parses a string representing a Date.
static int parseInt(java.lang.String str, int from, int to)
          Deprecated. Parses a positive integer embedded in a string.
static java.sql.Time parseTime(java.lang.String timeStr, java.util.GregorianCalendar calendar)
          Deprecated. Parses a string representing a Time.
static java.sql.Timestamp parseTimestamp(java.lang.String timestampStr, java.util.GregorianCalendar calendar)
          Deprecated. Parses a string representing a Timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_fractionalMultiplier

public static final int[] s_fractionalMultiplier
Deprecated. 
The number to multiply the parsed fraction by in parseTimestamp(). Indexed by the length of the fraction string.

Constructor Detail

StringConverter

public StringConverter()
Deprecated. 
Method Detail

parseDate

public static java.sql.Date parseDate(java.lang.String dateStr,
                                      java.util.GregorianCalendar calendar)
Deprecated. 
Parses a string representing a Date.

Parameters:
dateStr - The string representing the date
calendar - The calendar to be used to create the Date object. If NULL, the default JVM calendar is used.
Returns:
The Date object representation of the passed in string, or NULL if parsing failed.

parseInt

public static int parseInt(java.lang.String str,
                           int from,
                           int to)
Deprecated. 
Parses a positive integer embedded in a string.

Parameters:
str - The string containing the integer to be parsed. Must be non-null.
from - The index into str at which the integer begins. 0 <= from < str.length().
to - One past the index into str at which the integer ends. 0 <= to <= str.length(). Note: Parses the substring defined by str.substring(from, to). Will return -1 if this substring contains a non-numeric character, is empty, or is greater than 9 digits.
Returns:
The parsed integer, or -1 if there was an error parsing.

parseTime

public static java.sql.Time parseTime(java.lang.String timeStr,
                                      java.util.GregorianCalendar calendar)
Deprecated. 
Parses a string representing a Time. The format should be hh:mm:ss Except that the fields may be 1 or more digits long.

Parameters:
timeStr - The string representing the date
calendar - The calendar to be used to create the Time object. If NULL, the default JVM calendar is used.
Returns:
The Time object representation of the passed in string.

parseTimestamp

public static java.sql.Timestamp parseTimestamp(java.lang.String timestampStr,
                                                java.util.GregorianCalendar calendar)
Deprecated. 
Parses a string representing a Timestamp. The string should be in the format: yyyy-mm-dd hh:mm:ss.fffffffff except that each field except year and fractional seconds may be 1 or 2 digits. The year field can be 1 to 9 digits. The optional fractional seconds field can be 1 to 9 digits.

Parameters:
timestampStr - The string representing the timestamp
calendar - The calendar to be used to create the Timestamp object. If NULL, the default JVM calendar is used.
Returns:
The Timestamp object representation of the passed in string.
Throws:
java.lang.IllegalArgumentException - if timestampStr is not in the correct format.


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.