Java Doc for DateOnly.java in  » J2EE » Jaffa » org » jaffa » datatypes » 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 » J2EE » Jaffa » org.jaffa.datatypes 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jaffa.datatypes.DateOnly

DateOnly
public class DateOnly implements Cloneable,Comparable,Serializable,IDateBase(Code)
This class is used to hold DateOnly data. Instances of this class are immutable.



Constructor Summary
public  DateOnly()
     Creates an instance with the current date.
public  DateOnly(long timeInMillis)
     Creates an instance initialized to the input value.
public  DateOnly(java.util.Date utilDate)
     Creates an instance initialized to the input value.
public  DateOnly(Calendar calendar)
     Creates an instance initialized to the input value.
public  DateOnly(int year, int month, int day)
     Creates an instance initialized to the input value.

Method Summary
public static  DateOnlyaddDay(DateOnly date, int days)
     Create a new DateOnly object by adding the input days to the value of the input date. If the input days is a negative number, then the days will be subtracted.
Parameters:
  date - the input date.
Parameters:
  days - the days to add.
public static  DateOnlyaddMonth(DateOnly date, int months)
     Create a new DateOnly object by adding the input months to the value of the input date. If the input months is a negative number, then the months will be subtracted.
Parameters:
  date - the input date.
Parameters:
  months - the months to add.
public static  DateOnlyaddYear(DateOnly date, int years)
     Create a new DateOnly object by adding the input years to the value of the input date. If the input years is a negative number, then the years will be subtracted.
Parameters:
  date - the input date.
Parameters:
  years - the years to add.
public  Objectclone()
     Returns a clone of the object.
throws:
  CloneNotSupportedException - if cloning is not supported.
public  intcompareTo(Object obj)
     Compares this object with another DateOnly object.
Parameters:
  obj - the other DateOnly object.
public static  intdaysBetween(DateOnly date1, DateOnly date2)
     Returns the number of days between two dates.
Parameters:
  date1 - the first date.
Parameters:
  date2 - the second date.
public  booleanequals(Object obj)
     Compares this object with another DateOnly object. Returns a true if both the objects have the same value.
Parameters:
  obj - the other DateOnly object.
public  CalendargetCalendar()
     Returns the Calendar.
public  intgetDay()
     Returns the day.
public  intgetDayOfWeek()
     Returns the day of the week.
public  intgetDayOfWeekInMonth()
     Returns the day of the week in the month.
public  intgetDayOfYear()
     Returns the day of the year.
public  intgetFirstDayOfWeek()
     Returns the first day of the week.
public  intgetJulian()
     Returns the corresponding julian value.
public  intgetMonth()
     Returns the month.
public  java.sql.DategetSQLDate()
     Returns the value as a java.sql.Date object.
public  TimegetSQLTime()
     Returns the value as a java.sql.Time object.
public  longgetTime()
     Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object.
public  TimestampgetTimestamp()
     Returns the value as a java.sql.Timestamp object.
public  java.util.DategetUtilDate()
     Returns the value as a java.util.Date object.
public  intgetWeekOfMonth()
     Returns the week of the month.
public  intgetWeekOfYear()
     Returns the week of the year.
public  intgetYear()
     Returns the year.
public  inthashCode()
     Returns the hashCode of the value.
public  booleanisAfter(DateOnly when)
     Returns a true if this date is after the input date.
Parameters:
  when - the input date.
public  booleanisBefore(DateOnly when)
     Returns a true if this date is before the input date.
Parameters:
  when - the input date.
public static  DateOnlyparse(String dateString)
     This parses the input String, returning a DateOnly object with the corresponding value. The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime. It can also have values of the type - T, T - 1, T + 2..., where T = todays date. Additionally the input String can be a formatted String based on the default layout of the DateOnlyFieldMetaData.
Parameters:
  dateString - the String to be parsed.
public static  DateOnlyparse(String dateString, String layout)
     This parses the input String, returning a DateOnly object with the corresponding value. The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime. It can also have values of the type - T, T - 1, T + 2..., where T = todays date. Additionally the input String can be a formatted String based on the input layout or the default layout of the DateOnlyFieldMetaData.
Parameters:
  dateString - the String to be parsed.
Parameters:
  layout - the format used by the input String.
public static  DateTimetoDateTime(DateOnly date)
     Returns a DateTime object initialized to the input date.
Parameters:
  date - the input date.
public  StringtoString()
     Returns the diagnostic information.


Constructor Detail
DateOnly
public DateOnly()(Code)
Creates an instance with the current date.



DateOnly
public DateOnly(long timeInMillis)(Code)
Creates an instance initialized to the input value.
Parameters:
  timeInMillis - the initial value.



DateOnly
public DateOnly(java.util.Date utilDate)(Code)
Creates an instance initialized to the input value.
Parameters:
  utilDate - the initial value.



DateOnly
public DateOnly(Calendar calendar)(Code)
Creates an instance initialized to the input value.
Parameters:
  calendar - the initial value.



DateOnly
public DateOnly(int year, int month, int day)(Code)
Creates an instance initialized to the input value.
Parameters:
  year - the year.
Parameters:
  month - the month.
Parameters:
  day - the day.




Method Detail
addDay
public static DateOnly addDay(DateOnly date, int days)(Code)
Create a new DateOnly object by adding the input days to the value of the input date. If the input days is a negative number, then the days will be subtracted.
Parameters:
  date - the input date.
Parameters:
  days - the days to add. a DateOnly object with the value of the input date, incremented by the input days.



addMonth
public static DateOnly addMonth(DateOnly date, int months)(Code)
Create a new DateOnly object by adding the input months to the value of the input date. If the input months is a negative number, then the months will be subtracted.
Parameters:
  date - the input date.
Parameters:
  months - the months to add. a DateOnly object with the value of the input date, incremented by the input months.



addYear
public static DateOnly addYear(DateOnly date, int years)(Code)
Create a new DateOnly object by adding the input years to the value of the input date. If the input years is a negative number, then the years will be subtracted.
Parameters:
  date - the input date.
Parameters:
  years - the years to add. a DateOnly object with the value of the input date, incremented by the input years.



clone
public Object clone() throws CloneNotSupportedException(Code)
Returns a clone of the object.
throws:
  CloneNotSupportedException - if cloning is not supported. This should never happen. a clone of the object.



compareTo
public int compareTo(Object obj)(Code)
Compares this object with another DateOnly object.
Parameters:
  obj - the other DateOnly object. a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.



daysBetween
public static int daysBetween(DateOnly date1, DateOnly date2)(Code)
Returns the number of days between two dates.
Parameters:
  date1 - the first date.
Parameters:
  date2 - the second date. the number of days between two dates.



equals
public boolean equals(Object obj)(Code)
Compares this object with another DateOnly object. Returns a true if both the objects have the same value.
Parameters:
  obj - the other DateOnly object. a true if both the objects have the same value.



getCalendar
public Calendar getCalendar()(Code)
Returns the Calendar. the Calendar.



getDay
public int getDay()(Code)
Returns the day. the day.



getDayOfWeek
public int getDayOfWeek()(Code)
Returns the day of the week. the day of the week.



getDayOfWeekInMonth
public int getDayOfWeekInMonth()(Code)
Returns the day of the week in the month. the day of the week in the month.



getDayOfYear
public int getDayOfYear()(Code)
Returns the day of the year. the day of the year.



getFirstDayOfWeek
public int getFirstDayOfWeek()(Code)
Returns the first day of the week. the first day of the week.



getJulian
public int getJulian()(Code)
Returns the corresponding julian value. the corresponding julian value.



getMonth
public int getMonth()(Code)
Returns the month. the month.



getSQLDate
public java.sql.Date getSQLDate()(Code)
Returns the value as a java.sql.Date object. the value as a java.sql.Date object.



getSQLTime
public Time getSQLTime()(Code)
Returns the value as a java.sql.Time object. the value as a java.sql.Time object.



getTime
public long getTime()(Code)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object. the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object.



getTimestamp
public Timestamp getTimestamp()(Code)
Returns the value as a java.sql.Timestamp object. the value as a java.sql.Timestamp object.



getUtilDate
public java.util.Date getUtilDate()(Code)
Returns the value as a java.util.Date object. the value as a java.util.Date object.



getWeekOfMonth
public int getWeekOfMonth()(Code)
Returns the week of the month. the week of the month.



getWeekOfYear
public int getWeekOfYear()(Code)
Returns the week of the year. the week of the year.



getYear
public int getYear()(Code)
Returns the year. the year.



hashCode
public int hashCode()(Code)
Returns the hashCode of the value. the hashCode of the value.



isAfter
public boolean isAfter(DateOnly when)(Code)
Returns a true if this date is after the input date.
Parameters:
  when - the input date. a true if this date is after the input date.



isBefore
public boolean isBefore(DateOnly when)(Code)
Returns a true if this date is before the input date.
Parameters:
  when - the input date. a true if this date is before the input date.



parse
public static DateOnly parse(String dateString) throws ParseException(Code)
This parses the input String, returning a DateOnly object with the corresponding value. The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime. It can also have values of the type - T, T - 1, T + 2..., where T = todays date. Additionally the input String can be a formatted String based on the default layout of the DateOnlyFieldMetaData.
Parameters:
  dateString - the String to be parsed. a DateOnly object which has the value based on the input.
throws:
  ParseException - if any error occurs in parsing.



parse
public static DateOnly parse(String dateString, String layout) throws ParseException(Code)
This parses the input String, returning a DateOnly object with the corresponding value. The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime. It can also have values of the type - T, T - 1, T + 2..., where T = todays date. Additionally the input String can be a formatted String based on the input layout or the default layout of the DateOnlyFieldMetaData.
Parameters:
  dateString - the String to be parsed.
Parameters:
  layout - the format used by the input String. a DateOnly object which has the value based on the input.
throws:
  ParseException - if any error occurs in parsing.



toDateTime
public static DateTime toDateTime(DateOnly date)(Code)
Returns a DateTime object initialized to the input date.
Parameters:
  date - the input date. a DateTime object initialized to the input date.



toString
public String toString()(Code)
Returns the diagnostic information. the diagnostic information.



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.