uk.org.ogsadai.converters.webrowset.resultset.types
Class NumberStrategy

java.lang.Object
  extended byuk.org.ogsadai.converters.webrowset.resultset.types.TypeStrategy
      extended byuk.org.ogsadai.converters.webrowset.resultset.types.NumberStrategy
Direct Known Subclasses:
BigIntStrategy, DecimalStrategy, DoubleStrategy, FloatStrategy, IntegerStrategy, NumericStrategy, SmallIntStrategy, TinyIntStrategy

public class NumberStrategy
extends TypeStrategy

Converts an element of column type number.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
 
Constructor Summary
NumberStrategy()
           
 
Method Summary
 java.math.BigDecimal getBigDecimal(java.lang.String data)
          Returns the BigDecimal value of the input string.
 java.math.BigInteger getBigInteger(java.lang.String data)
          Converts a string into a BigInteger.
 boolean getBoolean(java.lang.String data)
          Returns the boolean value of the input string.
 byte getByte(java.lang.String data)
          Returns the byte value of the input string.
 double getDouble(java.lang.String data)
          Returns the double value of the input string.
 float getFloat(java.lang.String data)
          Returns the float value of the input string.
 int getInt(java.lang.String data)
          Returns the integer value of the input string.
 long getLong(java.lang.String data)
          Returns the long value of the input string.
 short getShort(java.lang.String data)
          Returns the short value of the input string.
 java.lang.String getString(java.lang.String data)
          Returns the input string.
 
Methods inherited from class uk.org.ogsadai.converters.webrowset.resultset.types.TypeStrategy
getArray, getAsciiStream, getBigDecimal, getBinaryStream, getBlob, getBytes, getCharacterStream, getClob, getDate, getDate, getObject, getRef, getTime, getTime, getTimestamp, getTimestamp, getUnicodeStream, getURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values
Constructor Detail

NumberStrategy

public NumberStrategy()
Method Detail

getBoolean

public boolean getBoolean(java.lang.String data)
                   throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the boolean value of the input string. This is true if the input is equal to "true" or "1" and false otherwise.

Overrides:
getBoolean in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getByte

public byte getByte(java.lang.String data)
             throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the byte value of the input string.

Overrides:
getByte in class TypeStrategy
Parameters:
data - Input data.
Returns:
byte value of the input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getShort

public short getShort(java.lang.String data)
               throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the short value of the input string.

Overrides:
getShort in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getInt

public int getInt(java.lang.String data)
           throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the integer value of the input string.

Overrides:
getInt in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getLong

public long getLong(java.lang.String data)
             throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the long value of the input string.

Overrides:
getLong in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getDouble

public double getDouble(java.lang.String data)
                 throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the double value of the input string.

Overrides:
getDouble in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getFloat

public float getFloat(java.lang.String data)
               throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the float value of the input string.

Overrides:
getFloat in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getString

public java.lang.String getString(java.lang.String data)
                           throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the input string.

Overrides:
getString in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String data)
                                   throws java.sql.SQLException
Description copied from class: TypeStrategy
Returns the BigDecimal value of the input string.

Overrides:
getBigDecimal in class TypeStrategy
Parameters:
data - Input data.
Returns:
converted input.
Throws:
java.sql.SQLException - if there was a problem with the conversion.

getBigInteger

public java.math.BigInteger getBigInteger(java.lang.String data)
                                   throws java.sql.SQLException
Converts a string into a BigInteger.

Parameters:
data - String to be converted.
Returns:
BigInteger representation of the input.
Throws:
java.sql.SQLException - if there was a problem converting the data.