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

All known Subclasses:   org.joda.time.base.BaseDuration,  org.joda.time.base.AbstractDuration,  org.joda.time.Duration,
ReadableDuration
public interface ReadableDuration extends Comparable(Code)
Defines an exact duration of time in milliseconds.

The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data, never to change it.

Methods that are passed a duration as a parameter will treat null as a zero length duration.
See Also:   ReadableInterval
See Also:   ReadablePeriod
author:
   Brian S O'Neill
author:
   Stephen Colebourne
since:
   1.0





Method Summary
 intcompareTo(Object obj)
     Compares this duration with the specified duration based on length.
 booleanequals(Object readableDuration)
     Compares this object with the specified object for equality based on the millisecond length.
 longgetMillis()
     Gets the total length of this duration in milliseconds.
 inthashCode()
     Gets a hash code for the duration that is compatable with the equals method.
 booleanisEqual(ReadableDuration duration)
     Is the length of this duration equal to the duration passed in.
 booleanisLongerThan(ReadableDuration duration)
     Is the length of this duration longer than the duration passed in.
 booleanisShorterThan(ReadableDuration duration)
     Is the length of this duration shorter than the duration passed in.
 DurationtoDuration()
     Get this duration as an immutable Duration object.
 PeriodtoPeriod()
     Converts this duration to a Period instance using the standard period type and the ISO chronology.

Only precise fields in the period type will be used.

 StringtoString()
     Gets the value as a String in the ISO8601 duration format using hours, minutes and seconds (including fractional milliseconds).



Method Detail
compareTo
int compareTo(Object obj)(Code)
Compares this duration with the specified duration based on length.
Parameters:
  obj - a duration to check against negative value if this is less, 0 if equal, or positive value if greater
throws:
  NullPointerException - if the object is null
throws:
  ClassCastException - if the given object is not supported



equals
boolean equals(Object readableDuration)(Code)
Compares this object with the specified object for equality based on the millisecond length. All ReadableDuration instances are accepted.
Parameters:
  readableDuration - a readable duration to check against true if the length of the duration is equal



getMillis
long getMillis()(Code)
Gets the total length of this duration in milliseconds. the total length of the time duration in milliseconds.



hashCode
int hashCode()(Code)
Gets a hash code for the duration that is compatable with the equals method. The following formula must be used:
 long len = getMillis();
 return (int) (len ^ (len >>> 32));
 
a hash code



isEqual
boolean isEqual(ReadableDuration duration)(Code)
Is the length of this duration equal to the duration passed in.
Parameters:
  duration - another duration to compare to, null means zero milliseconds true if this duration is equal to than the duration passed in



isLongerThan
boolean isLongerThan(ReadableDuration duration)(Code)
Is the length of this duration longer than the duration passed in.
Parameters:
  duration - another duration to compare to, null means zero milliseconds true if this duration is equal to than the duration passed in



isShorterThan
boolean isShorterThan(ReadableDuration duration)(Code)
Is the length of this duration shorter than the duration passed in.
Parameters:
  duration - another duration to compare to, null means zero milliseconds true if this duration is equal to than the duration passed in



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

This will either typecast this instance, or create a new Duration. a Duration created using the millisecond duration from this instance




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

Only precise fields in the period type will be used. Thus, only the hour, minute, second and millisecond fields on the period will be used. The year, month, week and day fields will not be populated.

If the duration is small, less than one day, then this method will perform as you might expect and split the fields evenly. If the duration is larger than one day then all the remaining duration will be stored in the largest available field, hours in this case.

For example, a duration effectively equal to (365 + 60 + 5) days will be converted to ((365 + 60 + 5) * 24) hours by this constructor.

For more control over the conversion process, you must pair the duration with an instant, see Period.Period(ReadableInstantReadableDuration) . a Period created using the millisecond duration from this instance




toString
String toString()(Code)
Gets the value as a String in the ISO8601 duration format using hours, minutes and seconds (including fractional milliseconds).

For example, "PT6H3M7S" represents 6 hours, 3 minutes, 7 seconds. the value as an ISO8601 string




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