|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.text.Format
com.davisor.data.Type
com.davisor.data.LocaleType
com.davisor.data.FormatType
com.davisor.data.SimpleNumberType
com.davisor.data.LongType
LongType defines a data type that supports long precision data.
DoubleType,
FloatType,
LongData,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.text.Format |
java.text.Format.Field |
| Field Summary | |
static LongType |
DEFAULT
Default long type. |
static java.lang.String |
TYPENAME
Type name ("LONG"). |
| Fields inherited from class com.davisor.data.FormatType |
M_pattern, M_sample |
| Fields inherited from class com.davisor.data.LocaleType |
DEFAULT_LOCALE, M_locale |
| Fields inherited from class com.davisor.data.Type |
METADATA_GROUP, METADATA_NAME, METADATA_PARENT, METADATA_SUBCHANNELS |
| Constructor Summary | |
|
LongType()
Default constructor. |
|
LongType(LongType it)
Copy constructor. |
|
LongType(java.lang.String dataName)
Creates a new default type with no identity. |
|
LongType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample)
Creates a new long type. |
|
LongType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
Creates a new named long number data type with the given decimal format pattern. |
protected |
LongType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample)
Creates a new long type. |
| Method Summary | |
long |
decode(java.lang.String value,
java.text.ParsePosition status)
Converts a string to an long value. |
com.davisor.core.Dupable |
dup()
Makes a deep copy of this object. |
java.lang.String |
encode(long value)
Converts an long to a string value. |
boolean |
equals(java.lang.Object o)
Tests if this object is equal with another object. |
int |
getSQLCode()
Gets the SQL type code, as defined by java.sql.Types. |
java.lang.Class |
getValueClass()
Gets value container class. |
DataValue |
toData(java.sql.CallableStatement statement,
int column)
Converts a callable statement variable to a data value. |
DataValue |
toData(java.lang.Object objectValue)
Converts an object to a data value. |
DataValue |
toData(java.sql.ResultSet resultSet,
int column)
Converts a result set column value to a data value. |
DataValue |
toData(java.lang.String stringValue,
java.text.ParsePosition status)
Converts a string to a data value. |
| Methods inherited from class com.davisor.data.SimpleNumberType |
byteValue, byteValue, createFormatter, doubleValue, doubleValue, floatValue, floatValue, intValue, intValue, longValue, longValue, numberValue, shortValue, shortValue, stringValue, stringValue, stringValue, stringValue, stringValue, stringValue, stringValue, zero |
| Methods inherited from class com.davisor.data.FormatType |
clearFormatter, getFormat, getFormatter, getPattern, getSample, hashCode, setFormat, setFormat, setLocale, setPattern, setSample |
| Methods inherited from class com.davisor.data.LocaleType |
getLocale, setLocale |
| Methods inherited from class com.davisor.data.Type |
ceil, check, check, compare, create, create, create, create, create, dup, floor, format, getCompatibility, getDataName, getId, getID, getMetaData, getMetaData, getSpecs, getSQLName, getSQLName, getTypeName, isNull, parseObject, register, register, setDataName, setId, setID, setMetaData, setMetaData, setSpecs, toString, toXML, xmlEnd, xmlStart |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final LongType DEFAULT
public static final java.lang.String TYPENAME
| Constructor Detail |
public LongType()
public LongType(LongType it)
public LongType(java.lang.String dataName)
dataName - data name (may be null)
public LongType(java.lang.String dataName,
java.lang.String id,
java.lang.String format)
This is the constructor the SQL type mapper Type.create(Integer,String,String,String) method will call to
create a type that matches given SQL type.
dataName - data name (may be null)id - type identity (may be null)format - decimal format pattern (may be null)FormatType.setFormat(java.util.Locale, java.lang.String)
public LongType(java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample)
dataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)
protected LongType(java.lang.String typeName,
java.lang.String dataName,
java.lang.String id,
java.util.Map metaData,
java.util.Locale locale,
java.lang.String pattern,
java.lang.Object sample)
typeName - type namedataName - data name (may be null)id - type identity (may be null)metaData - type meta data map (may be null)locale - type locale (may be null)pattern - format pattern (may be null)sample - format sample (may be null)| Method Detail |
public com.davisor.core.Dupable dup()
dup in interface com.davisor.core.Dupabledup in class Typepublic boolean equals(java.lang.Object o)
Long types are equal if their super-classes are.
equals in interface java.util.Comparatorequals in class FormatTypeCompare.equals(Object,Object)public int getSQLCode()
getSQLCode in class Typepublic java.lang.Class getValueClass()
getValueClass in class FormatType
public DataValue toData(java.sql.CallableStatement statement,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets statement long value, and returns a corresponding
LongData value.
toData in class Typestatement - statement holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(Object),
toData(ResultSet,int),
toData(String,ParsePosition),
LongData
public DataValue toData(java.lang.Object objectValue)
throws InvalidDataException
Number objects are converted directly, other objects are converted first to strings, then to enumerated values.
toData in class TypeobjectValue - data object (may be null)
InvalidDataException - if given object value could not be parsedtoData(CallableStatement,int),
toData(ResultSet,int),
toData(String,ParsePosition),
LongData
public DataValue toData(java.lang.String stringValue,
java.text.ParsePosition status)
throws InvalidDataException
Long type expects the given value to contain an long value
compatible with current number pattern, and returns a corresponding
LongData value
toData in class TypestringValue - data string (may be null)status - parse status (may be null)
InvalidDataException - if given string value could not be parsedtoData(CallableStatement,int),
toData(Object),
toData(ResultSet,int),
LongData
public DataValue toData(java.sql.ResultSet resultSet,
int column)
throws InvalidDataException,
java.sql.SQLException
Gets result set column long value, and returns a corresponding
LongData value.
toData in class TyperesultSet - resultSet holding the data value to be convertedcolumn - SQL column index for the data value to be converted
InvalidDataException - if given object value could not be parsed
java.sql.SQLException - if a SQL error occurstoData(CallableStatement,int),
toData(Object),
toData(String,ParsePosition),
LongData
public long decode(java.lang.String value,
java.text.ParsePosition status)
throws InvalidDataException
value - the value to be converted
InvalidDataException - if the value cannot
be convertedSimpleNumberType.longValue(String,ParsePosition)
public java.lang.String encode(long value)
throws InvalidDataException
value - the value to be converted
InvalidDataException - if the value cannot
be convertedSimpleNumberType.stringValue(long)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||