Java Doc for Duration.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) 


org.joda.time.base.BaseDuration
   org.joda.time.Duration

Duration
final public class Duration extends BaseDuration implements ReadableDuration,Serializable(Code)
An immutable duration specifying a length of time in milliseconds.

A duration is defined by a fixed number of milliseconds. There is no concept of fields, such as days or seconds, as these fields can vary in length. A duration may be converted to a Period to obtain field values. This conversion will typically cause a loss of precision however.

Duration is thread-safe and immutable.
author:
   Brian S O'Neill
author:
   Stephen Colebourne
since:
   1.0



Field Summary
final public static  DurationZERO
    

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

Method Summary
public  Durationminus(long amount)
     Returns a new duration with this length minus that specified.
public  Durationminus(ReadableDuration amount)
     Returns a new duration with this length minus that specified.
public  Durationplus(long amount)
     Returns a new duration with this length plus that specified.
public  Durationplus(ReadableDuration amount)
     Returns a new duration with this length plus that specified.
public  DurationtoDuration()
     Get this duration as an immutable Duration object by returning this.
public  DurationwithDurationAdded(long durationToAdd, int scalar)
     Returns a new duration with this length plus that specified multiplied by the scalar.
public  DurationwithDurationAdded(ReadableDuration durationToAdd, int scalar)
     Returns a new duration with this length plus that specified multiplied by the scalar.
public  DurationwithMillis(long duration)
     Creates a new Duration instance with a different milisecond length.

Field Detail
ZERO
final public static Duration ZERO(Code)
Constant representing zero millisecond duration




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



Duration
public Duration(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



Duration
public Duration(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



Duration
public Duration(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
minus
public Duration minus(long amount)(Code)
Returns a new duration with this length minus that specified. This instance is immutable and is not altered.

If the addition is zero, this instance is returned.
Parameters:
  amount - the duration to take away from this one the new duration instance




minus
public Duration minus(ReadableDuration amount)(Code)
Returns a new duration with this length minus that specified. This instance is immutable and is not altered.

If the amount is zero, this instance is returned.
Parameters:
  amount - the duration to take away from this one, null means zero the new duration instance




plus
public Duration plus(long amount)(Code)
Returns a new duration with this length plus that specified. This instance is immutable and is not altered.

If the addition is zero, this instance is returned.
Parameters:
  amount - the duration to add to this one the new duration instance




plus
public Duration plus(ReadableDuration amount)(Code)
Returns a new duration with this length plus that specified. This instance is immutable and is not altered.

If the amount is zero, this instance is returned.
Parameters:
  amount - the duration to add to this one, null means zero the new duration instance




toDuration
public Duration toDuration()(Code)
Get this duration as an immutable Duration object by returning this. this



withDurationAdded
public Duration withDurationAdded(long durationToAdd, int scalar)(Code)
Returns a new duration with this length plus that specified multiplied by the scalar. This instance is immutable and is not altered.

If the addition is zero, this instance is returned.
Parameters:
  durationToAdd - the duration to add to this one
Parameters:
  scalar - the amount of times to add, such as -1 to subtract once the new duration instance




withDurationAdded
public Duration withDurationAdded(ReadableDuration durationToAdd, int scalar)(Code)
Returns a new duration with this length plus that specified multiplied by the scalar. This instance is immutable and is not altered.

If the addition is zero, this instance is returned.
Parameters:
  durationToAdd - the duration to add to this one, null means zero
Parameters:
  scalar - the amount of times to add, such as -1 to subtract once the new duration instance




withMillis
public Duration withMillis(long duration)(Code)
Creates a new Duration instance with a different milisecond length.
Parameters:
  duration - the new length of the duration the new duration instance



Methods inherited from org.joda.time.base.BaseDuration
public long getMillis()(Code)(Java Doc)
protected void setMillis(long duration)(Code)(Java Doc)
public Interval toIntervalFrom(ReadableInstant startInstant)(Code)(Java Doc)
public Interval toIntervalTo(ReadableInstant endInstant)(Code)(Java Doc)
public Period toPeriod(PeriodType type)(Code)(Java Doc)
public Period toPeriod(Chronology chrono)(Code)(Java Doc)
public Period toPeriod(PeriodType type, Chronology chrono)(Code)(Java Doc)
public Period toPeriodFrom(ReadableInstant startInstant)(Code)(Java Doc)
public Period toPeriodFrom(ReadableInstant startInstant, PeriodType type)(Code)(Java Doc)
public Period toPeriodTo(ReadableInstant endInstant)(Code)(Java Doc)
public Period toPeriodTo(ReadableInstant endInstant, PeriodType type)(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.