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

All known Subclasses:   org.joda.time.Partial,  org.joda.time.base.BasePartial,  org.joda.time.base.BaseLocal,
AbstractPartial
abstract public class AbstractPartial implements ReadablePartial,Comparable(Code)
AbstractPartial provides a standard base implementation of most methods in the ReadablePartial interface.

Calculations on are performed using a Chronology . This chronology is set to be in the UTC time zone for all calculations.

The methods on this class use ReadablePartial.size , AbstractPartial.getField(intChronology) and ReadablePartial.getValue(int) to calculate their results. Subclasses may have a better implementation.

AbstractPartial allows subclasses may be mutable and not thread-safe.
author:
   Stephen Colebourne
since:
   1.0




Constructor Summary
protected  AbstractPartial()
     Constructor.

Method Summary
public  intcompareTo(Object partial)
     Compares this partial with another returning an integer indicating the order.
public  booleanequals(Object partial)
     Compares this ReadablePartial with another returning true if the chronology, field types and values are equal.
public  intget(DateTimeFieldType type)
     Get the value of one of the fields of a datetime.
abstract protected  DateTimeFieldgetField(int index, Chronology chrono)
     Gets the field for a specific index in the chronology specified.
public  DateTimeFieldgetField(int index)
     Gets the field at the specifed index.
public  DateTimeFieldTypegetFieldType(int index)
     Gets the field type at the specifed index.
public  DateTimeFieldType[]getFieldTypes()
     Gets an array of the field types that this partial supports.
public  DateTimeField[]getFields()
     Gets an array of the fields that this partial supports.
public  int[]getValues()
     Gets an array of the value of each of the fields that this partial supports.
public  inthashCode()
     Gets a hash code for the ReadablePartial that is compatible with the equals method.
public  intindexOf(DateTimeFieldType type)
     Gets the index of the specified field, or -1 if the field is unsupported.
protected  intindexOf(DurationFieldType type)
     Gets the index of the first fields to have the specified duration, or -1 if the field is unsupported.
protected  intindexOfSupported(DateTimeFieldType type)
     Gets the index of the specified field, throwing an exception if the field is unsupported.
protected  intindexOfSupported(DurationFieldType type)
     Gets the index of the first fields to have the specified duration, throwing an exception if the field is unsupported.
public  booleanisAfter(ReadablePartial partial)
     Is this partial later than the specified partial.

The fields are compared in order, from largest to smallest. The first field that is non-equal is used to determine the result.

You may not pass null into this method.

public  booleanisBefore(ReadablePartial partial)
     Is this partial earlier than the specified partial.

The fields are compared in order, from largest to smallest. The first field that is non-equal is used to determine the result.

You may not pass null into this method.

public  booleanisEqual(ReadablePartial partial)
     Is this partial the same as the specified partial.

The fields are compared in order, from largest to smallest. If all fields are equal, the result is true.

You may not pass null into this method.

public  booleanisSupported(DateTimeFieldType type)
     Checks whether the field specified is supported by this partial.
public  DateTimetoDateTime(ReadableInstant baseInstant)
     Resolves this partial against another complete instant to create a new full instant.
public  StringtoString(DateTimeFormatter formatter)
     Uses the specified formatter to convert this partial to a String.
Parameters:
  formatter - the formatter to use, null means use toString().


Constructor Detail
AbstractPartial
protected AbstractPartial()(Code)
Constructor.




Method Detail
compareTo
public int compareTo(Object partial)(Code)
Compares this partial with another returning an integer indicating the order.

The fields are compared in order, from largest to smallest. The first field that is non-equal is used to determine the result.

The specified object must be a partial instance whose field types match those of this partial.

NOTE: This implementation violates the Comparable contract. This method will accept any instance of ReadablePartial as input. However, it is possible that some implementations of ReadablePartial exist that do not extend AbstractPartial, and thus will throw a ClassCastException if compared in the opposite direction. The cause of this problem is that ReadablePartial doesn't define the compareTo() method, however we can't change that until v2.0.
Parameters:
  partial - an object to check against negative if this is less, zero if equal, positive if greater
throws:
  ClassCastException - if the partial is the wrong classor if it has field types that don't match
throws:
  NullPointerException - if the partial is null
since:
   1.1




equals
public boolean equals(Object partial)(Code)
Compares this ReadablePartial with another returning true if the chronology, field types and values are equal.
Parameters:
  partial - an object to check against true if fields and values are equal



get
public int get(DateTimeFieldType type)(Code)
Get the value of one of the fields of a datetime.

The field specified must be one of those that is supported by the partial.
Parameters:
  type - a DateTimeFieldType instance that is supported by this partial the value of that field
throws:
  IllegalArgumentException - if the field is null or not supported




getField
abstract protected DateTimeField getField(int index, Chronology chrono)(Code)
Gets the field for a specific index in the chronology specified.

This method must not use any instance variables.
Parameters:
  index - the index to retrieve
Parameters:
  chrono - the chronology to use the field
throws:
  IndexOutOfBoundsException - if the index is invalid




getField
public DateTimeField getField(int index)(Code)
Gets the field at the specifed index.
Parameters:
  index - the index the field
throws:
  IndexOutOfBoundsException - if the index is invalid



getFieldType
public DateTimeFieldType getFieldType(int index)(Code)
Gets the field type at the specifed index.
Parameters:
  index - the index the field type
throws:
  IndexOutOfBoundsException - if the index is invalid



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

The fields are returned largest to smallest, for example Hour, Minute, Second. the fields supported in an array that may be altered, largest to smallest




getFields
public DateTimeField[] getFields()(Code)
Gets an array of the fields that this partial supports.

The fields are returned largest to smallest, for example Hour, Minute, Second. 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 partial supports.

The fields are returned largest to smallest, for example Hour, Minute, Second. 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 ReadablePartial that is compatible with the equals method. a suitable hash code



indexOf
public int indexOf(DateTimeFieldType type)(Code)
Gets the index of the specified field, or -1 if the field is unsupported.
Parameters:
  type - the type to check, may be null which returns -1 the index of the field, -1 if unsupported



indexOf
protected int indexOf(DurationFieldType type)(Code)
Gets the index of the first fields to have the specified duration, or -1 if the field is unsupported.
Parameters:
  type - the type to check, may be null which returns -1 the index of the field, -1 if unsupported



indexOfSupported
protected int indexOfSupported(DateTimeFieldType type)(Code)
Gets the index of the specified field, throwing an exception if the field is unsupported.
Parameters:
  type - the type to check, not null the index of the field
throws:
  IllegalArgumentException - if the field is null or not supported



indexOfSupported
protected int indexOfSupported(DurationFieldType type)(Code)
Gets the index of the first fields to have the specified duration, throwing an exception if the field is unsupported.
Parameters:
  type - the type to check, not null the index of the field
throws:
  IllegalArgumentException - if the field is null or not supported



isAfter
public boolean isAfter(ReadablePartial partial)(Code)
Is this partial later than the specified partial.

The fields are compared in order, from largest to smallest. The first field that is non-equal is used to determine the result.

You may not pass null into this method. This is because you need a time zone to accurately determine the current date.
Parameters:
  partial - a partial to check against, must not be null true if this date is after the date passed in
throws:
  IllegalArgumentException - if the specified partial is null
throws:
  ClassCastException - if the partial has field types that don't match
since:
   1.1




isBefore
public boolean isBefore(ReadablePartial partial)(Code)
Is this partial earlier than the specified partial.

The fields are compared in order, from largest to smallest. The first field that is non-equal is used to determine the result.

You may not pass null into this method. This is because you need a time zone to accurately determine the current date.
Parameters:
  partial - a partial to check against, must not be null true if this date is before the date passed in
throws:
  IllegalArgumentException - if the specified partial is null
throws:
  ClassCastException - if the partial has field types that don't match
since:
   1.1




isEqual
public boolean isEqual(ReadablePartial partial)(Code)
Is this partial the same as the specified partial.

The fields are compared in order, from largest to smallest. If all fields are equal, the result is true.

You may not pass null into this method. This is because you need a time zone to accurately determine the current date.
Parameters:
  partial - a partial to check against, must not be null true if this date is the same as the date passed in
throws:
  IllegalArgumentException - if the specified partial is null
throws:
  ClassCastException - if the partial has field types that don't match
since:
   1.1




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



toDateTime
public DateTime toDateTime(ReadableInstant baseInstant)(Code)
Resolves this partial against another complete instant to create a new full instant. The combination is performed using the chronology of the specified instant.

For example, if this partial represents a time, then the result of this method will be the datetime from the specified base instant plus the time from this partial.
Parameters:
  baseInstant - the instant that provides the missing fields, null means now the combined datetime




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



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.