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

All known Subclasses:   org.joda.time.base.BasePeriod,
AbstractPeriod
abstract public class AbstractPeriod implements ReadablePeriod(Code)
AbstractPeriod provides the common behaviour for period classes.

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

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




Constructor Summary
protected  AbstractPeriod()
     Constructor.

Method Summary
public  booleanequals(Object period)
     Compares this object with the specified object for equality based on the value of each field.
public  intget(DurationFieldType type)
     Gets the value of one of the fields.
public  DurationFieldType[]getFieldTypes()
     Gets an array of the field types that this period supports.
public  int[]getValues()
     Gets an array of the value of each of the fields that this period supports.
public  inthashCode()
     Gets a hash code for the period as defined by ReadablePeriod.
public  intindexOf(DurationFieldType type)
     Gets the index of the field in this period.
public  booleanisSupported(DurationFieldType type)
     Checks whether the field specified is supported by this period.
public  MutablePeriodtoMutablePeriod()
     Get this object as a MutablePeriod.
public  PeriodtoPeriod()
     Get this period as an immutable Period object.
public  StringtoString()
     Gets the value as a String in the ISO8601 duration format.
public  StringtoString(PeriodFormatter formatter)
     Uses the specified formatter to convert this period to a String.
Parameters:
  formatter - the formatter to use, null means use toString().


Constructor Detail
AbstractPeriod
protected AbstractPeriod()(Code)
Constructor.




Method Detail
equals
public boolean equals(Object period)(Code)
Compares this object with the specified object for equality based on the value of each field. All ReadablePeriod instances are accepted.

Note that a period of 1 day is not equal to a period of 24 hours, nor is 1 hour equal to 60 minutes. Only periods with the same amount in each field are equal.

This is because periods represent an abstracted definition of a time period (eg. a day may not actually be 24 hours, it might be 23 or 25 at daylight savings boundary).

To compare the actual duration of two periods, convert both to org.joda.time.Duration Duration s, an operation that emphasises that the result may differ according to the date you choose.
Parameters:
  period - a readable period to check against true if all the field values are equal, false ifnot or the period is null or of an incorrect type




get
public int get(DurationFieldType type)(Code)
Gets the value of one of the fields.

If the field type specified is not supported by the period then zero is returned.
Parameters:
  type - the field type to query, null returns zero the value of that field, zero if field not supported




getFieldTypes
public DurationFieldType[] getFieldTypes()(Code)
Gets an array of the field types that this period supports.

The fields are returned largest to smallest, for example Hours, Minutes, Seconds. the fields supported in an array that may be altered, largest to smallest




getValues
public int[] getValues()(Code)
Gets an array of the value of each of the fields that this period supports.

The fields are returned largest to smallest, for example Hours, Minutes, Seconds. Each value corresponds to the same array index as getFields() the current values of each field in an array that may be altered, largest to smallest




hashCode
public int hashCode()(Code)
Gets a hash code for the period as defined by ReadablePeriod. a hash code



indexOf
public int indexOf(DurationFieldType type)(Code)
Gets the index of the field in this period.
Parameters:
  type - the type to check, may be null which returns -1 the index of -1 if not supported



isSupported
public boolean isSupported(DurationFieldType type)(Code)
Checks whether the field specified is supported by this period.
Parameters:
  type - the type to check, may be null which returns false true if the field is supported



toMutablePeriod
public MutablePeriod toMutablePeriod()(Code)
Get this object as a MutablePeriod.

This will always return a new MutablePeriod with the same fields. a MutablePeriod using the same field set and values




toPeriod
public Period toPeriod()(Code)
Get this period as an immutable Period object. a Period using the same field set and values



toString
public String toString()(Code)
Gets the value as a String in the ISO8601 duration format.

For example, "P6H3M7S" represents 6 hours, 3 minutes, 7 seconds.

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




toString
public String toString(PeriodFormatter formatter)(Code)
Uses the specified formatter to convert this period to a String.
Parameters:
  formatter - the formatter to use, null means use toString(). the formatted string
since:
   1.5



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.