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


java.lang.Object
   org.joda.time.PeriodType

PeriodType
public class PeriodType implements Serializable(Code)
Controls a period implementation by specifying which duration fields are to be used.

The following implementations are provided:

  • Standard - years, months, weeks, days, hours, minutes, seconds, millis
  • YearMonthDayTime - years, months, days, hours, minutes, seconds, millis
  • YearMonthDay - years, months, days
  • YearWeekDayTime - years, weeks, days, hours, minutes, seconds, millis
  • YearWeekDay - years, weeks, days
  • YearDayTime - years, days, hours, minutes, seconds, millis
  • YearDay - years, days, hours
  • DayTime - days, hours, minutes, seconds, millis
  • Time - hours, minutes, seconds, millis
  • plus one for each single type

PeriodType is thread-safe and immutable, and all subclasses must be as well.
author:
   Brian S O'Neill
author:
   Stephen Colebourne
since:
   1.0



Field Summary
static  intDAY_INDEX
    
static  intHOUR_INDEX
    
static  intMILLI_INDEX
    
static  intMINUTE_INDEX
    
static  intMONTH_INDEX
    
static  intSECOND_INDEX
    
static  intWEEK_INDEX
    
static  intYEAR_INDEX
    

Constructor Summary
protected  PeriodType(String name, DurationFieldType[] types, int[] indices)
     Constructor.

Method Summary
 booleanaddIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd)
     Adds to the indexed field part of the period.
public static  PeriodTypedayTime()
     Gets a type that defines all standard fields from days downwards.
public static  PeriodTypedays()
     Gets a type that defines just the days field.
public  booleanequals(Object obj)
     Compares this type to another object.
public static synchronized  PeriodTypeforFields(DurationFieldType[] types)
     Gets a period type that contains the duration types of the array.

Only the 8 standard duration field types are supported.
Parameters:
  types - the types to include in the array.

public  DurationFieldTypegetFieldType(int index)
     Gets the field type by index.
 intgetIndexedField(ReadablePeriod period, int index)
     Gets the indexed field part of the period.
public  StringgetName()
     Gets the name of the period type.
public  inthashCode()
     Returns a hashcode based on the field types.
public static  PeriodTypehours()
     Gets a type that defines just the hours field.
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 static  PeriodTypemillis()
     Gets a type that defines just the millis field.
public static  PeriodTypeminutes()
     Gets a type that defines just the minutes field.
public static  PeriodTypemonths()
     Gets a type that defines just the months field.
public static  PeriodTypeseconds()
     Gets a type that defines just the seconds field.
 booleansetIndexedField(ReadablePeriod period, int index, int[] values, int newValue)
     Sets the indexed field part of the period.
public  intsize()
     Gets the number of fields in the period type.
public static  PeriodTypestandard()
     Gets a type that defines all standard fields.
public static  PeriodTypetime()
     Gets a type that defines all standard time fields.
public  StringtoString()
     Gets a debugging to string.
public static  PeriodTypeweeks()
     Gets a type that defines just the weeks field.
public  PeriodTypewithDaysRemoved()
     Returns a version of this PeriodType instance that does not support days.
public  PeriodTypewithHoursRemoved()
     Returns a version of this PeriodType instance that does not support hours.
public  PeriodTypewithMillisRemoved()
     Returns a version of this PeriodType instance that does not support milliseconds.
public  PeriodTypewithMinutesRemoved()
     Returns a version of this PeriodType instance that does not support minutes.
public  PeriodTypewithMonthsRemoved()
     Returns a version of this PeriodType instance that does not support months.
public  PeriodTypewithSecondsRemoved()
     Returns a version of this PeriodType instance that does not support seconds.
public  PeriodTypewithWeeksRemoved()
     Returns a version of this PeriodType instance that does not support weeks.
public  PeriodTypewithYearsRemoved()
     Returns a version of this PeriodType instance that does not support years.
public static  PeriodTypeyearDay()
     Gets a type that defines the year and day fields.
public static  PeriodTypeyearDayTime()
     Gets a type that defines all standard fields except months and weeks.
public static  PeriodTypeyearMonthDay()
     Gets a type that defines the year, month and day fields.
public static  PeriodTypeyearMonthDayTime()
     Gets a type that defines all standard fields except weeks.
public static  PeriodTypeyearWeekDay()
     Gets a type that defines year, week and day fields.
public static  PeriodTypeyearWeekDayTime()
     Gets a type that defines all standard fields except months.
public static  PeriodTypeyears()
     Gets a type that defines just the years field.

Field Detail
DAY_INDEX
static int DAY_INDEX(Code)



HOUR_INDEX
static int HOUR_INDEX(Code)



MILLI_INDEX
static int MILLI_INDEX(Code)



MINUTE_INDEX
static int MINUTE_INDEX(Code)



MONTH_INDEX
static int MONTH_INDEX(Code)



SECOND_INDEX
static int SECOND_INDEX(Code)



WEEK_INDEX
static int WEEK_INDEX(Code)



YEAR_INDEX
static int YEAR_INDEX(Code)




Constructor Detail
PeriodType
protected PeriodType(String name, DurationFieldType[] types, int[] indices)(Code)
Constructor.
Parameters:
  name - the name
Parameters:
  types - the types
Parameters:
  indices - the indices




Method Detail
addIndexedField
boolean addIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd)(Code)
Adds to the indexed field part of the period.
Parameters:
  period - the period to query
Parameters:
  index - the index to use
Parameters:
  values - the array to populate
Parameters:
  valueToAdd - the value to add true if the array is updated
throws:
  UnsupportedOperationException - if not supported



dayTime
public static PeriodType dayTime()(Code)
Gets a type that defines all standard fields from days downwards.
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



days
public static PeriodType days()(Code)
Gets a type that defines just the days field. the period type



equals
public boolean equals(Object obj)(Code)
Compares this type to another object. To be equal, the object must be a PeriodType with the same set of fields.
Parameters:
  obj - the object to compare to true if equal



forFields
public static synchronized PeriodType forFields(DurationFieldType[] types)(Code)
Gets a period type that contains the duration types of the array.

Only the 8 standard duration field types are supported.
Parameters:
  types - the types to include in the array. the period type
since:
   1.1




getFieldType
public DurationFieldType getFieldType(int index)(Code)
Gets the field type by index.
Parameters:
  index - the index to retrieve the field type
throws:
  IndexOutOfBoundsException - if the index is invalid



getIndexedField
int getIndexedField(ReadablePeriod period, int index)(Code)
Gets the indexed field part of the period.
Parameters:
  period - the period to query
Parameters:
  index - the index to use the value of the field, zero if unsupported



getName
public String getName()(Code)
Gets the name of the period type. the name



hashCode
public int hashCode()(Code)
Returns a hashcode based on the field types. a suitable hashcode



hours
public static PeriodType hours()(Code)
Gets a type that defines just the hours field. the period type



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



millis
public static PeriodType millis()(Code)
Gets a type that defines just the millis field. the period type



minutes
public static PeriodType minutes()(Code)
Gets a type that defines just the minutes field. the period type



months
public static PeriodType months()(Code)
Gets a type that defines just the months field. the period type



seconds
public static PeriodType seconds()(Code)
Gets a type that defines just the seconds field. the period type



setIndexedField
boolean setIndexedField(ReadablePeriod period, int index, int[] values, int newValue)(Code)
Sets the indexed field part of the period.
Parameters:
  period - the period to query
Parameters:
  index - the index to use
Parameters:
  values - the array to populate
Parameters:
  newValue - the value to set
throws:
  UnsupportedOperationException - if not supported



size
public int size()(Code)
Gets the number of fields in the period type. the number of fields



standard
public static PeriodType standard()(Code)
Gets a type that defines all standard fields.
  • years
  • months
  • weeks
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



time
public static PeriodType time()(Code)
Gets a type that defines all standard time fields.
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



toString
public String toString()(Code)
Gets a debugging to string. a string



weeks
public static PeriodType weeks()(Code)
Gets a type that defines just the weeks field. the period type



withDaysRemoved
public PeriodType withDaysRemoved()(Code)
Returns a version of this PeriodType instance that does not support days. a new period type that supports the original set of fields except days



withHoursRemoved
public PeriodType withHoursRemoved()(Code)
Returns a version of this PeriodType instance that does not support hours. a new period type that supports the original set of fields except hours



withMillisRemoved
public PeriodType withMillisRemoved()(Code)
Returns a version of this PeriodType instance that does not support milliseconds. a new period type that supports the original set of fields except milliseconds



withMinutesRemoved
public PeriodType withMinutesRemoved()(Code)
Returns a version of this PeriodType instance that does not support minutes. a new period type that supports the original set of fields except minutes



withMonthsRemoved
public PeriodType withMonthsRemoved()(Code)
Returns a version of this PeriodType instance that does not support months. a new period type that supports the original set of fields except months



withSecondsRemoved
public PeriodType withSecondsRemoved()(Code)
Returns a version of this PeriodType instance that does not support seconds. a new period type that supports the original set of fields except seconds



withWeeksRemoved
public PeriodType withWeeksRemoved()(Code)
Returns a version of this PeriodType instance that does not support weeks. a new period type that supports the original set of fields except weeks



withYearsRemoved
public PeriodType withYearsRemoved()(Code)
Returns a version of this PeriodType instance that does not support years. a new period type that supports the original set of fields except years



yearDay
public static PeriodType yearDay()(Code)
Gets a type that defines the year and day fields.
  • years
  • days
the period type
since:
   1.1



yearDayTime
public static PeriodType yearDayTime()(Code)
Gets a type that defines all standard fields except months and weeks.
  • years
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



yearMonthDay
public static PeriodType yearMonthDay()(Code)
Gets a type that defines the year, month and day fields.
  • years
  • months
  • days
the period type
since:
   1.1



yearMonthDayTime
public static PeriodType yearMonthDayTime()(Code)
Gets a type that defines all standard fields except weeks.
  • years
  • months
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



yearWeekDay
public static PeriodType yearWeekDay()(Code)
Gets a type that defines year, week and day fields.
  • years
  • weeks
  • days
the period type
since:
   1.1



yearWeekDayTime
public static PeriodType yearWeekDayTime()(Code)
Gets a type that defines all standard fields except months.
  • years
  • weeks
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
the period type



years
public static PeriodType years()(Code)
Gets a type that defines just the years field. the period type



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.