Java Doc for DateTimeUtils.java in  » Development » Joda-Time » org » joda » time » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Joda Time » org.joda.time 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.joda.time.DateTimeUtils

DateTimeUtils
public class DateTimeUtils (Code)
DateTimeUtils provide public utility methods for the datetime library.

DateTimeUtils is thread-safe although shared static variables are used.
author:
   Stephen Colebourne
since:
   1.0


Inner Class :abstract static class MillisProvider
Inner Class :static class SystemMillisProvider extends MillisProvider
Inner Class :static class FixedMillisProvider extends MillisProvider
Inner Class :static class OffsetMillisProvider extends MillisProvider


Constructor Summary
protected  DateTimeUtils()
    

Method Summary
final public static  longcurrentTimeMillis()
     Gets the current time in milliseconds.
final public static  ChronologygetChronology(Chronology chrono)
     Gets the chronology handling null.

If the chronology is null, ISOChronology.getInstance will be returned.

final public static  longgetDurationMillis(ReadableDuration duration)
     Gets the millisecond duration from the specified duration object handling null.
final public static  ChronologygetInstantChronology(ReadableInstant instant)
     Gets the chronology from the specified instant object handling null.
final public static  longgetInstantMillis(ReadableInstant instant)
     Gets the millisecond instant from the specified instant object handling null.

If the instant object is null, the DateTimeUtils.currentTimeMillis() will be returned.

final public static  ChronologygetIntervalChronology(ReadableInstant start, ReadableInstant end)
     Gets the chronology from the specified instant based interval handling null.

The chronology is obtained from the start if that is not null, or from the end if the start is null.

final public static  ChronologygetIntervalChronology(ReadableInterval interval)
     Gets the chronology from the specified interval object handling null.
final public static  PeriodTypegetPeriodType(PeriodType type)
     Gets the period type handling null.

If the zone is null, PeriodType.standard will be returned.

final public static  ReadableIntervalgetReadableInterval(ReadableInterval interval)
     Gets the interval handling null.

If the interval is null, an interval representing now to now in the ISOChronology.getInstance ISOChronology will be returned.

final public static  DateTimeZonegetZone(DateTimeZone zone)
     Gets the zone handling null.

If the zone is null, DateTimeZone.getDefault will be returned.

final public static  booleanisContiguous(ReadablePartial partial)
     Checks whether the partial is contiguous.
final public static  voidsetCurrentMillisFixed(long fixedMillis)
     Sets the current time to return a fixed millisecond time.
final public static  voidsetCurrentMillisOffset(long offsetMillis)
     Sets the current time to return the system time plus an offset.
final public static  voidsetCurrentMillisSystem()
     Resets the current time to return the system time.


Constructor Detail
DateTimeUtils
protected DateTimeUtils()(Code)
Restrictive constructor




Method Detail
currentTimeMillis
final public static long currentTimeMillis()(Code)
Gets the current time in milliseconds.

By default this returns System.currentTimeMillis(). This may be changed using other methods in this class. the current time in milliseconds from 1970-01-01T00:00:00Z




getChronology
final public static Chronology getChronology(Chronology chrono)(Code)
Gets the chronology handling null.

If the chronology is null, ISOChronology.getInstance will be returned. Otherwise, the chronology is returned.
Parameters:
  chrono - the chronology to use, null means ISO in the default zone the chronology, never null




getDurationMillis
final public static long getDurationMillis(ReadableDuration duration)(Code)
Gets the millisecond duration from the specified duration object handling null.

If the duration object is null, zero will be returned. Otherwise, the millis from the object are returned.
Parameters:
  duration - the duration to examine, null means zero the duration in milliseconds




getInstantChronology
final public static Chronology getInstantChronology(ReadableInstant instant)(Code)
Gets the chronology from the specified instant object handling null.

If the instant object is null, or the instant's chronology is null, ISOChronology.getInstance will be returned. Otherwise, the chronology from the object is returned.
Parameters:
  instant - the instant to examine, null means ISO in the default zone the chronology, never null




getInstantMillis
final public static long getInstantMillis(ReadableInstant instant)(Code)
Gets the millisecond instant from the specified instant object handling null.

If the instant object is null, the DateTimeUtils.currentTimeMillis() will be returned. Otherwise, the millis from the object are returned.
Parameters:
  instant - the instant to examine, null means now the time in milliseconds from 1970-01-01T00:00:00Z




getIntervalChronology
final public static Chronology getIntervalChronology(ReadableInstant start, ReadableInstant end)(Code)
Gets the chronology from the specified instant based interval handling null.

The chronology is obtained from the start if that is not null, or from the end if the start is null. The result is additionally checked, and if still null then ISOChronology.getInstance will be returned.
Parameters:
  start - the instant to examine and use as the primary source of the chronology
Parameters:
  end - the instant to examine and use as the secondary source of the chronology the chronology, never null




getIntervalChronology
final public static Chronology getIntervalChronology(ReadableInterval interval)(Code)
Gets the chronology from the specified interval object handling null.

If the interval object is null, or the interval's chronology is null, ISOChronology.getInstance will be returned. Otherwise, the chronology from the object is returned.
Parameters:
  interval - the interval to examine, null means ISO in the default zone the chronology, never null




getPeriodType
final public static PeriodType getPeriodType(PeriodType type)(Code)
Gets the period type handling null.

If the zone is null, PeriodType.standard will be returned. Otherwise, the type specified is returned.
Parameters:
  type - the time zone to use, null means the standard type the type to use, never null




getReadableInterval
final public static ReadableInterval getReadableInterval(ReadableInterval interval)(Code)
Gets the interval handling null.

If the interval is null, an interval representing now to now in the ISOChronology.getInstance ISOChronology will be returned. Otherwise, the interval specified is returned.
Parameters:
  interval - the interval to use, null means now to now the interval, never null
since:
   1.1




getZone
final public static DateTimeZone getZone(DateTimeZone zone)(Code)
Gets the zone handling null.

If the zone is null, DateTimeZone.getDefault will be returned. Otherwise, the zone specified is returned.
Parameters:
  zone - the time zone to use, null means the default zone the time zone, never null




isContiguous
final public static boolean isContiguous(ReadablePartial partial)(Code)
Checks whether the partial is contiguous.

A partial is contiguous if one field starts where another ends.

For example LocalDate is contiguous because DayOfMonth has the same range (Month) as the unit of the next field (MonthOfYear), and MonthOfYear has the same range (Year) as the unit of the next field (Year).

Similarly, LocalTime is contiguous, as it consists of MillisOfSecond, SecondOfMinute, MinuteOfHour and HourOfDay (note how the names of each field 'join up').

However, a Year/HourOfDay partial is not contiguous because the range field Day is not equal to the next field Year. Similarly, a DayOfWeek/DayOfMonth partial is not contiguous because the range Month is not equal to the next field Day.
Parameters:
  partial - the partial to check true if the partial is contiguous
throws:
  IllegalArgumentException - if the partial is null
since:
   1.1




setCurrentMillisFixed
final public static void setCurrentMillisFixed(long fixedMillis) throws SecurityException(Code)
Sets the current time to return a fixed millisecond time.

This method changes the behaviour of DateTimeUtils.currentTimeMillis() . Whenever the current time is queried, the same millisecond time will be returned.
Parameters:
  fixedMillis - the fixed millisecond time to use
throws:
  SecurityException - if the application does not have sufficient security rights




setCurrentMillisOffset
final public static void setCurrentMillisOffset(long offsetMillis) throws SecurityException(Code)
Sets the current time to return the system time plus an offset.

This method changes the behaviour of DateTimeUtils.currentTimeMillis() . Whenever the current time is queried, System.currentTimeMillis is used and then offset by adding the millisecond value specified here.
Parameters:
  offsetMillis - the fixed millisecond time to use
throws:
  SecurityException - if the application does not have sufficient security rights




setCurrentMillisSystem
final public static void setCurrentMillisSystem() throws SecurityException(Code)
Resets the current time to return the system time.

This method changes the behaviour of DateTimeUtils.currentTimeMillis() . Whenever the current time is queried, System.currentTimeMillis is used.
throws:
  SecurityException - if the application does not have sufficient security rights




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.