com.simba.dsi.dataengine.utilities
Class TimeTz

java.lang.Object
  extended by java.util.Date
      extended by java.sql.Time
          extended by com.simba.dsi.dataengine.utilities.TimeTz
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Date>

public class TimeTz
extends java.sql.Time

This class represents a Time with a timezone.

See Also:
Serialized Form

Constructor Summary
TimeTz(long timeMillis, java.util.Calendar timezoneCal)
          Constructor.
TimeTz(java.sql.Time time, java.util.Calendar timezoneCal)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Compares two Time for equality.
 java.sql.Time getAdjustedTime()
          Get the Time object adjusted to the JVM timezone.
 java.util.Calendar getTimezoneCalendar()
          Gets the Calendar holding the timezone information.
 int hashCode()
           
 java.lang.String toString()
          Formats a time in JDBC time escape format.
 
Methods inherited from class java.sql.Time
getDate, getDay, getMonth, getYear, setDate, setMonth, setTime, setYear, valueOf
 
Methods inherited from class java.util.Date
after, before, compareTo, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeTz

public TimeTz(java.sql.Time time,
              java.util.Calendar timezoneCal)
Constructor.

Parameters:
time - The SQL Time object.
timezoneCal - The Calendar holding the timezone information. If no Calendar is specified, use the default JVM timezone.

TimeTz

public TimeTz(long timeMillis,
              java.util.Calendar timezoneCal)
Constructor.

Parameters:
timeMillis - The time in milliseconds.
timezoneCal - The Calendar holding the timezone information. If no Calendar is specified, use the default JVM timezone.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two Time for equality. The result is true if and only if the argument is not null and is a Date object that represents the same point in time, to the millisecond, as this object.

Thus, two Date objects are equal if and only if the getTime method returns the same long value for both.

Overrides:
equals in class java.util.Date
Parameters:
obj - The object to compare with.
Returns:
true if the objects are the same; false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.util.Date

getAdjustedTime

public java.sql.Time getAdjustedTime()
Get the Time object adjusted to the JVM timezone.

Returns:
The adjusted Time object.

getTimezoneCalendar

public java.util.Calendar getTimezoneCalendar()
Gets the Calendar holding the timezone information.

Returns:
The Calendar holding the timezone information.

toString

public java.lang.String toString()
Formats a time in JDBC time escape format.

Overrides:
toString in class java.sql.Time
Returns:
a String in hh:mm:ss.SSS format

clone

public java.lang.Object clone()
Overrides:
clone in class java.util.Date


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