com.davisor.data
Class TimeOutputType

java.lang.Object
  extended byjava.text.Format
      extended bycom.davisor.data.Type
          extended bycom.davisor.data.LocaleType
              extended bycom.davisor.data.FormatType
                  extended bycom.davisor.data.DateFormatType
                      extended bycom.davisor.data.TimestampType
                          extended bycom.davisor.data.TimeType
                              extended bycom.davisor.data.TimeOutputType
All Implemented Interfaces:
java.lang.Cloneable, java.util.Comparator, com.davisor.core.Dupable, java.io.Serializable

public class TimeOutputType
extends TimeType

TimeOutputType defines a data type that formats time strings using given localization format, but always parses them as SQL times or timestamp.

Since:
JDK1.1
See Also:
DateOutputType, TimeData, TimeType, Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static java.lang.String TYPENAME
          Type name ("OTIME").
 
Fields inherited from class com.davisor.data.TimeType
DEFAULT
 
Fields inherited from class com.davisor.data.DateFormatType
GMT, LOCAL, M_style, M_timeZone
 
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
  TimeOutputType()
          Default constructor.
  TimeOutputType(java.lang.String dataName)
          Creates a new default type with no identity.
  TimeOutputType(java.lang.String dataName, java.lang.String id, java.util.Map metaData, java.util.Locale locale, java.lang.String pattern, java.lang.Object sample, int style, java.util.TimeZone timeZone)
          Creates a new date type.
  TimeOutputType(java.lang.String dataName, java.lang.String id, java.lang.String format)
          Create a new time output type with localized time parsing.
protected TimeOutputType(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, int style, java.util.TimeZone timeZone)
          Creates a new date type.
  TimeOutputType(TimeOutputType dot)
          Copy constructor.
 
Method Summary
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 java.util.Date timeValue(java.lang.String value)
          Parse a time string as SQL time, regardless of the current type specifications.
 
Methods inherited from class com.davisor.data.TimeType
createFormatter, equals, getSQLCode, stringValue, strip, toData, toData
 
Methods inherited from class com.davisor.data.TimestampType
zero
 
Methods inherited from class com.davisor.data.DateFormatType
createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, createCalendar, dateValue, getFormat, getLast, getStyle, getTimeZone, getValueClass, hashCode, setFormat, setStyle, setTimeZone, toData, toData, toData, toData
 
Methods inherited from class com.davisor.data.FormatType
clearFormatter, getFormatter, getPattern, getSample, 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

TYPENAME

public static final java.lang.String TYPENAME
Type name ("OTIME").

See Also:
Constant Field Values
Constructor Detail

TimeOutputType

public TimeOutputType()
Default constructor.


TimeOutputType

public TimeOutputType(TimeOutputType dot)
Copy constructor.


TimeOutputType

public TimeOutputType(java.lang.String dataName)
Creates a new default type with no identity.

Parameters:
dataName - data name (may be null)

TimeOutputType

public TimeOutputType(java.lang.String dataName,
                      java.lang.String id,
                      java.lang.String format)
Create a new time output type with localized time parsing.

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.

Parameters:
dataName - data name
id - type identity
format - language and country codes, separated by single space characters. null or an empty specification string implies SQL time formatting.
See Also:
DateFormatType.setFormat(java.lang.String)

TimeOutputType

public TimeOutputType(java.lang.String dataName,
                      java.lang.String id,
                      java.util.Map metaData,
                      java.util.Locale locale,
                      java.lang.String pattern,
                      java.lang.Object sample,
                      int style,
                      java.util.TimeZone timeZone)
Creates a new date type.

Parameters:
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)
style - date format style, as defined by the DateFormat class
timeZone - date format time zone

TimeOutputType

protected TimeOutputType(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,
                         int style,
                         java.util.TimeZone timeZone)
Creates a new date type.

Parameters:
typeName - type name
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)
style - date format style, as defined by the DateFormat class
timeZone - date format time zone
Method Detail

timeValue

public java.util.Date timeValue(java.lang.String value)
                         throws NullDataException
Parse a time string as SQL time, regardless of the current type specifications. Even a SQL timestamp will do.

Parameters:
value - a SQL time string
Returns:
Time object corresponding 'value'.
Throws:
NullDataException - 'value' is null or empty.
See Also:
Time.valueOf(java.lang.String)

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
Overrides:
dup in class TimeType


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.