org.exist.xquery.value
Class TimeUtils

java.lang.Object
  extended by org.exist.xquery.value.TimeUtils

public class TimeUtils
extends Object

Centralizes access to time-related utility functions. Mostly delegates to the XML datatype factory, serving as a central chokepoint to control concurrency issues. It's not clear if instances of the factory are in fact thread-safe or not; if they turn out not to be, it will be easy to either synchronize access or create more instances here as required.

Author:
Piotr Kaminski

Method Summary
static TimeUtils getInstance()
           
 int getLocalTimezoneOffsetMillis()
           
 int getLocalTimezoneOffsetMinutes()
           
 Duration newDuration(boolean arg0, BigInteger arg1, BigInteger arg2, BigInteger arg3, BigInteger arg4, BigInteger arg5, BigDecimal arg6)
           
 Duration newDuration(boolean arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6)
           
 Duration newDuration(long arg0)
           
 Duration newDuration(String arg0)
           
 Duration newDurationDayTime(boolean arg0, BigInteger arg1, BigInteger arg2, BigInteger arg3, BigInteger arg4)
           
 Duration newDurationDayTime(boolean arg0, int arg1, int arg2, int arg3, int arg4)
           
 Duration newDurationDayTime(long arg0)
           
 Duration newDurationDayTime(String arg0)
           
 Duration newDurationYearMonth(boolean arg0, BigInteger arg1, BigInteger arg2)
           
 Duration newDurationYearMonth(boolean arg0, int arg1, int arg2)
           
 Duration newDurationYearMonth(long arg0)
           
 Duration newDurationYearMonth(String arg0)
           
 XMLGregorianCalendar newXMLGregorianCalendar()
           
 XMLGregorianCalendar newXMLGregorianCalendar(BigInteger arg0, int arg1, int arg2, int arg3, int arg4, int arg5, BigDecimal arg6, int arg7)
           
 XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar arg0)
           
 XMLGregorianCalendar newXMLGregorianCalendar(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
           
 XMLGregorianCalendar newXMLGregorianCalendar(String arg0)
           
 XMLGregorianCalendar newXMLGregorianCalendarDate(int arg0, int arg1, int arg2, int arg3)
           
 XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, BigDecimal arg3, int arg4)
           
 XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, int arg3)
           
 XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0, int arg1, int arg2, int arg3, int arg4)
           
 void overrideLocalTimezoneOffset(int millis)
          Set the offset of the local timezone, ignoring the default provided by the OS.
 void resetLocalTimezoneOffset()
          Cancel any timezone override that may be in effect, reverting back to the OS value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TimeUtils getInstance()

overrideLocalTimezoneOffset

public void overrideLocalTimezoneOffset(int millis)
Set the offset of the local timezone, ignoring the default provided by the OS. Mainly useful for testing.

Parameters:
millis - the timezone offset in milliseconds, positive or negative

resetLocalTimezoneOffset

public void resetLocalTimezoneOffset()
Cancel any timezone override that may be in effect, reverting back to the OS value.


getLocalTimezoneOffsetMillis

public int getLocalTimezoneOffsetMillis()

getLocalTimezoneOffsetMinutes

public int getLocalTimezoneOffsetMinutes()

newDuration

public Duration newDuration(long arg0)

newDuration

public Duration newDuration(String arg0)

newDuration

public Duration newDuration(boolean arg0,
                            int arg1,
                            int arg2,
                            int arg3,
                            int arg4,
                            int arg5,
                            int arg6)

newDuration

public Duration newDuration(boolean arg0,
                            BigInteger arg1,
                            BigInteger arg2,
                            BigInteger arg3,
                            BigInteger arg4,
                            BigInteger arg5,
                            BigDecimal arg6)

newDurationDayTime

public Duration newDurationDayTime(long arg0)

newDurationDayTime

public Duration newDurationDayTime(String arg0)

newDurationDayTime

public Duration newDurationDayTime(boolean arg0,
                                   int arg1,
                                   int arg2,
                                   int arg3,
                                   int arg4)

newDurationDayTime

public Duration newDurationDayTime(boolean arg0,
                                   BigInteger arg1,
                                   BigInteger arg2,
                                   BigInteger arg3,
                                   BigInteger arg4)

newDurationYearMonth

public Duration newDurationYearMonth(long arg0)

newDurationYearMonth

public Duration newDurationYearMonth(String arg0)

newDurationYearMonth

public Duration newDurationYearMonth(boolean arg0,
                                     int arg1,
                                     int arg2)

newDurationYearMonth

public Duration newDurationYearMonth(boolean arg0,
                                     BigInteger arg1,
                                     BigInteger arg2)

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar()

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar(int arg0,
                                                    int arg1,
                                                    int arg2,
                                                    int arg3,
                                                    int arg4,
                                                    int arg5,
                                                    int arg6,
                                                    int arg7)

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar(String arg0)

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar(BigInteger arg0,
                                                    int arg1,
                                                    int arg2,
                                                    int arg3,
                                                    int arg4,
                                                    int arg5,
                                                    BigDecimal arg6,
                                                    int arg7)

newXMLGregorianCalendar

public XMLGregorianCalendar newXMLGregorianCalendar(GregorianCalendar arg0)

newXMLGregorianCalendarDate

public XMLGregorianCalendar newXMLGregorianCalendarDate(int arg0,
                                                        int arg1,
                                                        int arg2,
                                                        int arg3)

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                        int arg1,
                                                        int arg2,
                                                        int arg3)

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                        int arg1,
                                                        int arg2,
                                                        int arg3,
                                                        int arg4)

newXMLGregorianCalendarTime

public XMLGregorianCalendar newXMLGregorianCalendarTime(int arg0,
                                                        int arg1,
                                                        int arg2,
                                                        BigDecimal arg3,
                                                        int arg4)


Copyright (C) Wolfgang Meier. All rights reserved.