jet.connect
Class DbTime

java.lang.Object
  extended by jet.connect.DbValue
      extended by jet.connect.DbDateTime
          extended by jet.connect.DbTime
All Implemented Interfaces:
jet.util.DbValueable, jet.util.QuickSortableNode

public class DbTime
extends DbDateTime

The DbTime class wraps a value of primitive type long in an object. An object of the type DbTime contains a single field whose type is long.

In addition, this class provides several methods for the interconversion of a DbTime and a String, as well as other constants and methods used when dealing with a DbTime.


Field Summary
 
Fields inherited from class jet.connect.DbDateTime
value
 
Fields inherited from class jet.connect.DbValue
bNull, CHAR_DESC, CURRENCY_DESC, DATE_DESC, desc, DOUBLE_DESC, INTEGER_DESC, TIME_DESC
 
Fields inherited from interface jet.util.DbValueable
EQUAL, GREATER, LESS
 
Constructor Summary
DbTime()
          Constructs an uninitialized DbTime.
DbTime(DbColDesc desc)
          Constructs an uninitialized DbTime.
DbTime(java.sql.Time v)
          Constructs an uninitialized DbTime.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this DbTime object.
 java.sql.Time getTime()
          Returns a java.sql.Time object using the milliseconds time value.
 void set(JRHierarchicalDataset hds, int col)
          Sets a newly allocated DbTime object that represents the long value indicated by the JRHierarchicalDataset parameter and an index of column.
 void set(java.sql.ResultSet rs, int col)
          Sets a newly allocated DbTime object that represents the long value indicated by the ResultSet parameter and an index of column.
 void setTime(java.sql.Time v)
          Sets an existing java.sql.Time object using the given milliseconds time value.
 void setValue(java.lang.String v)
          Sets a newly allocated DbTime object that represents the String value indicated by the String parameter.
 java.lang.String toString()
          Returns a String object representing this DbTime's value.
 
Methods inherited from class jet.connect.DbDateTime
compareTo, equals, get, set, set, toFormatString, toSqlDate, toStringValue, toUtilDate
 
Methods inherited from class jet.connect.DbValue
compareTo, compareTo, equals, getColDesc, getPrecision, getScale, getSqlType, isCurrency, isNull, makeDbValue, setColDesc, setfoo, setNull, setValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbTime

public DbTime()
Constructs an uninitialized DbTime. This DbTime object is mutable until the value and the description of the column are set.


DbTime

public DbTime(java.sql.Time v)
Constructs an uninitialized DbTime. This DbTime object is mutable until DbColDesc is set.

Parameters:
v - The value holding a java.sql.Time object.

DbTime

public DbTime(DbColDesc desc)
Constructs an uninitialized DbTime. This DbTime object is mutable until the value is set.

Parameters:
desc - The value to be represented by the DbColDesc object.
Method Detail

getTime

public java.sql.Time getTime()
Returns a java.sql.Time object using the milliseconds time value.


setTime

public void setTime(java.sql.Time v)
Sets an existing java.sql.Time object using the given milliseconds time value. It uses Time.getTime() to retrieve value.

Parameters:
v - the valid Time value

set

public void set(java.sql.ResultSet rs,
                int col)
         throws java.sql.SQLException
Sets a newly allocated DbTime object that represents the long value indicated by the ResultSet parameter and an index of column.

Specified by:
set in class DbValue
Parameters:
rs - The ResultSet to be fetched.
col - The index of the column.
Throws:
java.sql.SQLException - if the ResultSet does not contain the index.

set

public void set(JRHierarchicalDataset hds,
                int col)
         throws java.sql.SQLException
Sets a newly allocated DbTime object that represents the long value indicated by the JRHierarchicalDataset parameter and an index of column.

Overrides:
set in class DbValue
Parameters:
hds - The JRHierarchicalDataset to be fetched.
col - The index of the column.
Throws:
java.sql.SQLException - if the ResultSet does not contain the index.

toString

public java.lang.String toString()
Returns a String object representing this DbTime's value. The value is returned as a string. If the value is null, it returns "NULL".

Specified by:
toString in class DbValue
Returns:
a string representation of the value of this object.

clone

public java.lang.Object clone()
Creates a clone of this DbTime object.

Specified by:
clone in interface jet.util.DbValueable
Specified by:
clone in class DbValue

setValue

public void setValue(java.lang.String v)
Sets a newly allocated DbTime object that represents the String value indicated by the String parameter.

Specified by:
setValue in class DbValue
Parameters:
v - The String to be converted to a DbTime. The time is in the format "hh:mm:ss".