Package org.apache.calcite.util
Class TimeWithTimeZoneString
java.lang.Object
org.apache.calcite.util.TimeWithTimeZoneString
- All Implemented Interfaces:
- Comparable<TimeWithTimeZoneString>
Time with time-zone literal.
 
Immutable, internally represented as a string (in ISO format), and can support unlimited precision (milliseconds, nanoseconds).
- 
Constructor SummaryConstructorsConstructorDescriptionTimeWithTimeZoneString(int h, int m, int s, String timeZone) Creates a TimeWithTimeZoneString for hour, minute, second and millisecond values in the given time-zone.Creates a TimeWithTimeZoneString.TimeWithTimeZoneString(TimeString localTime, TimeZone timeZone) Creates a TimeWithTimeZoneString.
- 
Method SummaryModifier and TypeMethodDescriptionintbooleanstatic TimeWithTimeZoneStringfromCalendarFields(Calendar calendar) Creates a TimeWithTimeZoneString from a Calendar.static TimeWithTimeZoneStringfromMillisOfDay(int i) inthashCode()round(int precision) toString()toString(int precision) Converts this TimeWithTimeZoneString to a string, truncated or padded with zeros to a given precision.withFraction(String fraction) Sets the fraction field of aTimeWithTimeZoneString.withMillis(int millis) Sets the fraction field of aTimeWithTimeZoneStringto a given number of milliseconds.withNanos(int nanos) Sets the fraction field of aTimeStringto a given number of nanoseconds.withTimeZone(TimeZone timeZone) 
- 
Constructor Details- 
TimeWithTimeZoneStringCreates a TimeWithTimeZoneString.
- 
TimeWithTimeZoneStringCreates a TimeWithTimeZoneString.
- 
TimeWithTimeZoneStringCreates a TimeWithTimeZoneString for hour, minute, second and millisecond values in the given time-zone.
 
- 
- 
Method Details- 
withMillisSets the fraction field of aTimeWithTimeZoneStringto a given number of milliseconds. Nukes the value set viawithNanos(int).For example, new TimeWithTimeZoneString(1970, 1, 1, 2, 3, 4, "UTC").withMillis(56)yieldsTIME WITH LOCAL TIME ZONE '1970-01-01 02:03:04.056 UTC'.
- 
fromCalendarFieldsCreates a TimeWithTimeZoneString from a Calendar.
- 
withNanosSets the fraction field of aTimeStringto a given number of nanoseconds. Nukes the value set viawithMillis(int).For example, new TimeWithTimeZoneString(1970, 1, 1, 2, 3, 4, "UTC").withNanos(56789)yieldsTIME WITH LOCAL TIME ZONE '1970-01-01 02:03:04.000056789 UTC'.
- 
withFractionSets the fraction field of aTimeWithTimeZoneString. The precision is determined by the number of leading zeros. Trailing zeros are stripped.For example, new TimeWithTimeZoneString(1970, 1, 1, 2, 3, 4, "UTC").withFraction("00506000")yieldsTIME WITH LOCAL TIME ZONE '1970-01-01 02:03:04.00506 UTC'.
- 
withTimeZone
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
compareTo- Specified by:
- compareToin interface- Comparable<TimeWithTimeZoneString>
 
- 
round
- 
fromMillisOfDay
- 
toStringConverts this TimeWithTimeZoneString to a string, truncated or padded with zeros to a given precision.
- 
getLocalTimeString
 
-