com.simba.dsi.dataengine.utilities
Class TimestampTz

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

public class TimestampTz
extends java.sql.Timestamp

This class represents a Timestamp with a timezone.

See Also:
Serialized Form

Constructor Summary
TimestampTz(long timeMillis, java.util.Calendar timezoneCal)
          Constructor.
TimestampTz(long timeMillis, int nanos, java.util.Calendar timezoneCal)
          Constructor.
TimestampTz(java.sql.Timestamp timestamp, java.util.Calendar timezoneCal)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object ts)
          Tests to see if this TimestampTz object is equal to the given object.
 java.sql.Timestamp getAdjustedTimestamp()
          Get the Timestamp object adjusted to the JVM timezone.
 java.util.Calendar getTimezoneCalendar()
          Gets the Calendar holding the timezone information.
 int hashCode()
           
 
Methods inherited from class java.sql.Timestamp
after, before, compareTo, compareTo, equals, getNanos, getTime, setNanos, setTime, toString, valueOf
 
Methods inherited from class java.util.Date
after, before, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimestampTz

public TimestampTz(java.sql.Timestamp timestamp,
                   java.util.Calendar timezoneCal)
Constructor.

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

TimestampTz

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

Parameters:
timeMillis - The time in milliseconds for a timestamp with no nanos seconds.
timezoneCal - The Calendar holding the timezone information. If no Calendar is specified, use the default JVM timezone.

TimestampTz

public TimestampTz(long timeMillis,
                   int nanos,
                   java.util.Calendar timezoneCal)
Constructor.

Parameters:
timeMillis - The time in milliseconds.
nanos - The nanos seconds.
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 ts)
Tests to see if this TimestampTz object is equal to the given object.

This TimestampTz will be considered equal to the input if the other is a TimestampTz, its time and nanos members are equal to this Object's and its TimeZone offset is equal to this Object's TimeZone offset.

Note: This method is not symmetric with respect to the equals(Object) method in the base class.

Overrides:
equals in class java.sql.Timestamp
Parameters:
ts - The Object value to compare with.
Returns:
true if the given Object instance is equal to this TimestampTz object; false otherwise

hashCode

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

getAdjustedTimestamp

public java.sql.Timestamp getAdjustedTimestamp()
Get the Timestamp object adjusted to the JVM timezone.

Returns:
The adjusted Timestamp object.

getTimezoneCalendar

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

Returns:
The Calendar holding the timezone information.

clone

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


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