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

All known Subclasses:   org.joda.time.base.AbstractDateTime,  org.joda.time.Instant,
AbstractInstant
abstract public class AbstractInstant implements ReadableInstant(Code)
AbstractInstant provides the common behaviour for instant classes.

This class has no concept of a chronology, all methods work on the millisecond instant.

This class should generally not be used directly by API users. The ReadableInstant interface should be used when different kinds of date/time objects are to be referenced.

Whenever you want to implement ReadableInstant you should extend this class.

AbstractInstant itself is thread-safe and immutable, but subclasses may be mutable and not thread-safe.
author:
   Stephen Colebourne
author:
   Brian S O'Neill
since:
   1.0




Constructor Summary
protected  AbstractInstant()
     Constructor.

Method Summary
public  intcompareTo(Object instant)
     Compares this object with the specified object for ascending millisecond instant order.
public  booleanequals(Object readableInstant)
     Compares this object with the specified object for equality based on the millisecond instant, chronology and time zone.

Two objects which represent the same instant in time, but are in different time zones (based on time zone id), will be considered to be different.

public  intget(DateTimeFieldType type)
     Get the value of one of the fields of a datetime using the chronology of the instant.
public  intget(DateTimeField field)
     Get the value of one of the fields of a datetime.
public  DateTimeZonegetZone()
     Gets the time zone of the instant from the chronology.
public  inthashCode()
     Gets a hash code for the instant as defined in ReadableInstant.
public  booleanisAfter(long instant)
     Is this instant after the millisecond instant passed in comparing solely by millisecond.
public  booleanisAfter(ReadableInstant instant)
     Is this instant after the instant passed in comparing solely by millisecond.
public  booleanisAfterNow()
     Is this instant after the current instant comparing solely by millisecond.
public  booleanisBefore(long instant)
     Is this instant before the millisecond instant passed in comparing solely by millisecond.
public  booleanisBefore(ReadableInstant instant)
     Is this instant before the instant passed in comparing solely by millisecond.
public  booleanisBeforeNow()
     Is this instant before the current instant comparing solely by millisecond.
public  booleanisEqual(long instant)
     Is this instant equal to the millisecond instant passed in comparing solely by millisecond.
public  booleanisEqual(ReadableInstant instant)
     Is this instant equal to the instant passed in comparing solely by millisecond.
public  booleanisEqualNow()
     Is this instant equal to the current instant comparing solely by millisecond.
public  booleanisSupported(DateTimeFieldType type)
     Checks if the field type specified is supported by this instant and chronology.
public  DatetoDate()
     Get the date time as a java.util.Date.
public  DateTimetoDateTime()
     Get this object as a DateTime in the same zone.
public  DateTimetoDateTime(DateTimeZone zone)
     Get this object as a DateTime using the same chronology but a different zone.
public  DateTimetoDateTime(Chronology chronology)
     Get this object as a DateTime using the given chronology and its zone.
public  DateTimetoDateTimeISO()
     Get this object as a DateTime using ISOChronology in the same zone.
public  InstanttoInstant()
     Get this object as an Instant.
public  MutableDateTimetoMutableDateTime()
     Get this object as a MutableDateTime in the same zone.
public  MutableDateTimetoMutableDateTime(DateTimeZone zone)
     Get this object as a MutableDateTime using the same chronology but a different zone.
public  MutableDateTimetoMutableDateTime(Chronology chronology)
     Get this object as a MutableDateTime using the given chronology and its zone.
public  MutableDateTimetoMutableDateTimeISO()
     Get this object as a MutableDateTime using ISOChronology in the same zone.
public  StringtoString()
     Output the date time in ISO8601 format (yyyy-MM-ddTHH:mm:ss.SSSZ).
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
AbstractInstant
protected AbstractInstant()(Code)
Constructor.




Method Detail
compareTo
public int compareTo(Object instant)(Code)
Compares this object with the specified object for ascending millisecond instant order. This ordering is inconsistent with equals, as it ignores the Chronology.

All ReadableInstant instances are accepted.
Parameters:
  instant - a readable instant 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 object type is not supported




equals
public boolean equals(Object readableInstant)(Code)
Compares this object with the specified object for equality based on the millisecond instant, chronology and time zone.

Two objects which represent the same instant in time, but are in different time zones (based on time zone id), will be considered to be different. Only two objects with the same DateTimeZone , Chronology and instant are equal.

See AbstractInstant.isEqual(ReadableInstant) for an equals method that ignores the Chronology and time zone.

All ReadableInstant instances are accepted.
Parameters:
  readableInstant - a readable instant to check against true if millisecond and chronology are equal, false ifnot or the instant is null or of an incorrect type




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

This method uses the chronology of the instant to obtain the value. For example:

 DateTime dt = new DateTime();
 int year = dt.get(DateTimeFieldType.year());
 

Parameters:
  type - a field type, usually obtained from DateTimeFieldType, not null the value of that field
throws:
  IllegalArgumentException - if the field type is null



get
public int get(DateTimeField field)(Code)
Get the value of one of the fields of a datetime.

This could be used to get a field using a different Chronology. For example:

 Instant dt = new Instant();
 int gjYear = dt.get(Chronology.getCoptic().year());
 

Parameters:
  field - the DateTimeField to use, not null the value
throws:
  IllegalArgumentException - if the field is null



getZone
public DateTimeZone getZone()(Code)
Gets the time zone of the instant from the chronology. the DateTimeZone that the instant is using, never null



hashCode
public int hashCode()(Code)
Gets a hash code for the instant as defined in ReadableInstant. a suitable hash code



isAfter
public boolean isAfter(long instant)(Code)
Is this instant after the millisecond instant passed in comparing solely by millisecond.
Parameters:
  instant - a millisecond instant to check against true if this instant is after the instant passed in



isAfter
public boolean isAfter(ReadableInstant instant)(Code)
Is this instant after the instant passed in comparing solely by millisecond.
Parameters:
  instant - an instant to check against, null means now true if the instant is after the instant passed in



isAfterNow
public boolean isAfterNow()(Code)
Is this instant after the current instant comparing solely by millisecond. true if this instant is after the current instant



isBefore
public boolean isBefore(long instant)(Code)
Is this instant before the millisecond instant passed in comparing solely by millisecond.
Parameters:
  instant - a millisecond instant to check against true if this instant is before the instant passed in



isBefore
public boolean isBefore(ReadableInstant instant)(Code)
Is this instant before the instant passed in comparing solely by millisecond.
Parameters:
  instant - an instant to check against, null means now true if the instant is before the instant passed in



isBeforeNow
public boolean isBeforeNow()(Code)
Is this instant before the current instant comparing solely by millisecond. true if this instant is before the current instant



isEqual
public boolean isEqual(long instant)(Code)
Is this instant equal to the millisecond instant passed in comparing solely by millisecond.
Parameters:
  instant - a millisecond instant to check against true if this instant is before the instant passed in



isEqual
public boolean isEqual(ReadableInstant instant)(Code)
Is this instant equal to the instant passed in comparing solely by millisecond.
Parameters:
  instant - an instant to check against, null means now true if the instant is equal to the instant passed in



isEqualNow
public boolean isEqualNow()(Code)
Is this instant equal to the current instant comparing solely by millisecond. true if this instant is before the current instant



isSupported
public boolean isSupported(DateTimeFieldType type)(Code)
Checks if the field type specified is supported by this instant and chronology. This can be used to avoid exceptions in AbstractInstant.get(DateTimeFieldType) .
Parameters:
  type - a field type, usually obtained from DateTimeFieldType true if the field type is supported



toDate
public Date toDate()(Code)
Get the date time as a java.util.Date.

The Date object created has exactly the same millisecond instant as this object. a Date initialised with this datetime




toDateTime
public DateTime toDateTime()(Code)
Get this object as a DateTime in the same zone. a DateTime using the same millis



toDateTime
public DateTime toDateTime(DateTimeZone zone)(Code)
Get this object as a DateTime using the same chronology but a different zone.
Parameters:
  zone - time zone to apply, or default if null a DateTime using the same millis



toDateTime
public DateTime toDateTime(Chronology chronology)(Code)
Get this object as a DateTime using the given chronology and its zone.
Parameters:
  chronology - chronology to apply, or ISOChronology if null a DateTime using the same millis



toDateTimeISO
public DateTime toDateTimeISO()(Code)
Get this object as a DateTime using ISOChronology in the same zone. a DateTime using the same millis with ISOChronology



toInstant
public Instant toInstant()(Code)
Get this object as an Instant. an Instant using the same millis



toMutableDateTime
public MutableDateTime toMutableDateTime()(Code)
Get this object as a MutableDateTime in the same zone. a MutableDateTime using the same millis



toMutableDateTime
public MutableDateTime toMutableDateTime(DateTimeZone zone)(Code)
Get this object as a MutableDateTime using the same chronology but a different zone.
Parameters:
  zone - time zone to apply, or default if null a MutableDateTime using the same millis



toMutableDateTime
public MutableDateTime toMutableDateTime(Chronology chronology)(Code)
Get this object as a MutableDateTime using the given chronology and its zone.
Parameters:
  chronology - chronology to apply, or ISOChronology if null a MutableDateTime using the same millis



toMutableDateTimeISO
public MutableDateTime toMutableDateTimeISO()(Code)
Get this object as a MutableDateTime using ISOChronology in the same zone. a MutableDateTime using the same millis with ISOChronology



toString
public String toString()(Code)
Output the date time in ISO8601 format (yyyy-MM-ddTHH:mm:ss.SSSZ). ISO8601 time formatted string.



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.