Java Doc for BaseDuration.java in  » Development » Joda-Time » org » joda » time » base » 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.base 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.joda.time.base.AbstractDuration
      org.joda.time.base.BaseDuration

All known Subclasses:   org.joda.time.Duration,
BaseDuration
abstract public class BaseDuration extends AbstractDuration implements ReadableDuration,Serializable(Code)
BaseDuration is an abstract implementation of ReadableDuration that stores data in a long duration milliseconds field.

This class should generally not be used directly by API users. The ReadableDuration interface should be used when different kinds of duration objects are to be referenced.

BaseDuration subclasses may be mutable and not thread-safe.
author:
   Brian S O'Neill
author:
   Stephen Colebourne
since:
   1.0




Constructor Summary
protected  BaseDuration(long duration)
     Creates a duration from the given millisecond duration.
protected  BaseDuration(long startInstant, long endInstant)
     Creates a duration from the given interval endpoints.
protected  BaseDuration(ReadableInstant start, ReadableInstant end)
     Creates a duration from the given interval endpoints.
protected  BaseDuration(Object duration)
     Creates a duration from the specified object using the org.joda.time.convert.ConverterManager ConverterManager .

Method Summary
public  longgetMillis()
     Gets the length of this duration in milliseconds.
protected  voidsetMillis(long duration)
     Sets the length of this duration in milliseconds.
public  IntervaltoIntervalFrom(ReadableInstant startInstant)
     Converts this duration to an Interval starting at the specified instant.
public  IntervaltoIntervalTo(ReadableInstant endInstant)
     Converts this duration to an Interval ending at the specified instant.
public  PeriodtoPeriod(PeriodType type)
     Converts this duration to a Period instance using the specified period type and the ISO chronology.
public  PeriodtoPeriod(Chronology chrono)
     Converts this duration to a Period instance using the standard period type and the specified chronology.
public  PeriodtoPeriod(PeriodType type, Chronology chrono)
     Converts this duration to a Period instance using the specified period type and chronology.
public  PeriodtoPeriodFrom(ReadableInstant startInstant)
     Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval using the standard period type.
public  PeriodtoPeriodFrom(ReadableInstant startInstant, PeriodType type)
     Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval.
public  PeriodtoPeriodTo(ReadableInstant endInstant)
     Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type.
public  PeriodtoPeriodTo(ReadableInstant endInstant, PeriodType type)
     Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type.


Constructor Detail
BaseDuration
protected BaseDuration(long duration)(Code)
Creates a duration from the given millisecond duration.
Parameters:
  duration - the duration, in milliseconds



BaseDuration
protected BaseDuration(long startInstant, long endInstant)(Code)
Creates a duration from the given interval endpoints.
Parameters:
  startInstant - interval start, in milliseconds
Parameters:
  endInstant - interval end, in milliseconds
throws:
  ArithmeticException - if the duration exceeds a 64 bit long



BaseDuration
protected BaseDuration(ReadableInstant start, ReadableInstant end)(Code)
Creates a duration from the given interval endpoints.
Parameters:
  start - interval start, null means now
Parameters:
  end - interval end, null means now
throws:
  ArithmeticException - if the duration exceeds a 64 bit long



BaseDuration
protected BaseDuration(Object duration)(Code)
Creates a duration from the specified object using the org.joda.time.convert.ConverterManager ConverterManager .
Parameters:
  duration - duration to convert
throws:
  IllegalArgumentException - if duration is invalid




Method Detail
getMillis
public long getMillis()(Code)
Gets the length of this duration in milliseconds. the length of the duration in milliseconds.



setMillis
protected void setMillis(long duration)(Code)
Sets the length of this duration in milliseconds.
Parameters:
  duration - the new length of the duration



toIntervalFrom
public Interval toIntervalFrom(ReadableInstant startInstant)(Code)
Converts this duration to an Interval starting at the specified instant.
Parameters:
  startInstant - the instant to start the interval at, null means now an Interval starting at the specified instant



toIntervalTo
public Interval toIntervalTo(ReadableInstant endInstant)(Code)
Converts this duration to an Interval ending at the specified instant.
Parameters:
  endInstant - the instant to end the interval at, null means now an Interval ending at the specified instant



toPeriod
public Period toPeriod(PeriodType type)(Code)
Converts this duration to a Period instance using the specified period type and the ISO chronology.

Only precise fields in the period type will be used. At most these are hours, minutes, seconds and millis - the period type may restrict the selection further.

For more control over the conversion process, you must pair the duration with an instant, see BaseDuration.toPeriodFrom(ReadableInstant,PeriodType) .
Parameters:
  type - the period type to use, null means standard a Period created using the millisecond duration from this instance




toPeriod
public Period toPeriod(Chronology chrono)(Code)
Converts this duration to a Period instance using the standard period type and the specified chronology.

Only precise fields in the period type will be used. Exactly which fields are precise depends on the chronology. Only the time fields are precise for ISO chronology with a time zone. However, ISO UTC also has precise days and weeks.

For more control over the conversion process, you must pair the duration with an instant, see BaseDuration.toPeriodFrom(ReadableInstant) and BaseDuration.toPeriodTo(ReadableInstant)
Parameters:
  chrono - the chronology to use, null means ISO default a Period created using the millisecond duration from this instance




toPeriod
public Period toPeriod(PeriodType type, Chronology chrono)(Code)
Converts this duration to a Period instance using the specified period type and chronology.

Only precise fields in the period type will be used. Exactly which fields are precise depends on the chronology. Only the time fields are precise for ISO chronology with a time zone. However, ISO UTC also has precise days and weeks.

For more control over the conversion process, you must pair the duration with an instant, see BaseDuration.toPeriodFrom(ReadableInstant,PeriodType) and BaseDuration.toPeriodTo(ReadableInstant,PeriodType)
Parameters:
  type - the period type to use, null means standard
Parameters:
  chrono - the chronology to use, null means ISO default a Period created using the millisecond duration from this instance




toPeriodFrom
public Period toPeriodFrom(ReadableInstant startInstant)(Code)
Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval using the standard period type.

This conversion will determine the fields of a period accurately. The results are based on the instant millis, the chronology of the instant, the standard period type and the length of this duration.
Parameters:
  startInstant - the instant to calculate the period from, null means now a Period created using the millisecond duration from this instance




toPeriodFrom
public Period toPeriodFrom(ReadableInstant startInstant, PeriodType type)(Code)
Converts this duration to a Period instance by adding the duration to a start instant to obtain an interval.

This conversion will determine the fields of a period accurately. The results are based on the instant millis, the chronology of the instant, the period type and the length of this duration.
Parameters:
  startInstant - the instant to calculate the period from, null means now
Parameters:
  type - the period type determining how to split the duration into fields, null means All type a Period created using the millisecond duration from this instance




toPeriodTo
public Period toPeriodTo(ReadableInstant endInstant)(Code)
Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type.

This conversion will determine the fields of a period accurately. The results are based on the instant millis, the chronology of the instant, the standard period type and the length of this duration.
Parameters:
  endInstant - the instant to calculate the period to, null means now a Period created using the millisecond duration from this instance




toPeriodTo
public Period toPeriodTo(ReadableInstant endInstant, PeriodType type)(Code)
Converts this duration to a Period instance by subtracting the duration from an end instant to obtain an interval using the standard period type.

This conversion will determine the fields of a period accurately. The results are based on the instant millis, the chronology of the instant, the period type and the length of this duration.
Parameters:
  endInstant - the instant to calculate the period to, null means now
Parameters:
  type - the period type determining how to split the duration into fields, null means All type a Period created using the millisecond duration from this instance




Methods inherited from org.joda.time.base.AbstractDuration
public int compareTo(Object obj)(Code)(Java Doc)
public boolean equals(Object duration)(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isEqual(ReadableDuration duration)(Code)(Java Doc)
public boolean isLongerThan(ReadableDuration duration)(Code)(Java Doc)
public boolean isShorterThan(ReadableDuration duration)(Code)(Java Doc)
public Duration toDuration()(Code)(Java Doc)
public Period toPeriod()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.