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

All known Subclasses:   org.joda.time.base.BaseDuration,
AbstractDuration
abstract public class AbstractDuration implements ReadableDuration(Code)
AbstractDuration provides the common behaviour for duration classes.

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

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




Constructor Summary
protected  AbstractDuration()
     Constructor.

Method Summary
public  intcompareTo(Object obj)
     Compares this duration with the specified duration based on length.
public  booleanequals(Object duration)
     Compares this object with the specified object for equality based on the millisecond length.
public  inthashCode()
     Gets a hash code for the duration that is compatible with the equals method.
public  booleanisEqual(ReadableDuration duration)
     Is the length of this duration equal to the duration passed in.
public  booleanisLongerThan(ReadableDuration duration)
     Is the length of this duration longer than the duration passed in.
public  booleanisShorterThan(ReadableDuration duration)
     Is the length of this duration shorter than the duration passed in.
public  DurationtoDuration()
     Get this duration as an immutable Duration object.
public  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.

public  StringtoString()
     Gets the value as a String in the ISO8601 duration format including only seconds and milliseconds.


Constructor Detail
AbstractDuration
protected AbstractDuration()(Code)
Constructor.




Method Detail
compareTo
public 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
public boolean equals(Object duration)(Code)
Compares this object with the specified object for equality based on the millisecond length. All ReadableDuration instances are accepted.
Parameters:
  duration - a readable duration to check against true if the length of the duration is equal



hashCode
public int hashCode()(Code)
Gets a hash code for the duration that is compatible with the equals method. a hash code



isEqual
public 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
public 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
public 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
public Duration toDuration()(Code)
Get this duration as an immutable Duration object. a Duration created using the millisecond duration from this instance



toPeriod
public 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
public String toString()(Code)
Gets the value as a String in the ISO8601 duration format including only seconds and milliseconds.

For example, "PT72.345S" represents 1 minute, 12 seconds and 345 milliseconds.

For more control over the output, see org.joda.time.format.PeriodFormatterBuilder PeriodFormatterBuilder . the value as an ISO8601 string




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.