Java Doc for SerialDate.java in  » Graphic-Library » jcommon-components » org » jfree » date » 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 » Graphic Library » jcommon components » org.jfree.date 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jfree.date.SerialDate

All known Subclasses:   org.jfree.date.SpreadsheetDate,
SerialDate
abstract public class SerialDate implements Comparable,Serializable,MonthConstants(Code)
An abstract class that defines our requirements for manipulating dates, without tying down a particular implementation.

Requirement 1 : match at least what Excel does for dates; Requirement 2 : the date represented by the class is immutable;

Why not just use java.util.Date? We will, when it makes sense. At times, java.util.Date can be *too* precise - it represents an instant in time, accurate to 1/1000th of a second (with the date itself depending on the time-zone). Sometimes we just want to represent a particular day (e.g. 21 January 2015) without concerning ourselves about the time of day, or the time-zone, or anything else. That's what we've defined SerialDate for.

You can call getInstance() to get a concrete subclass of SerialDate, without worrying about the exact implementation.
author:
   David Gilbert



Field Summary
final static  int[]AGGREGATE_DAYS_TO_END_OF_MONTH
     The number of days in a (non-leap) year up to the end of each month.
final static  int[]AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH
     The number of days in a year up to the end of the preceding month.
final public static  DateFormatSymbolsDATE_FORMAT_SYMBOLS
     Date format symbols.
final public static  intFIRST_WEEK_IN_MONTH
     A useful constant for referring to the first week in a month.
final public static  intFOLLOWING
     Useful constant for specifying a day of the week relative to a fixed date.
final public static  intFOURTH_WEEK_IN_MONTH
     A useful constant for referring to the fourth week in a month.
final public static  intFRIDAY
     Useful constant for Friday.
final public static  intINCLUDE_BOTH
     Useful range constant.
final public static  intINCLUDE_FIRST
     Useful range constant.
final public static  intINCLUDE_NONE
     Useful range constant.
final public static  intINCLUDE_SECOND
     Useful range constant.
final static  int[]LAST_DAY_OF_MONTH
     The number of days in each month in non leap years.
final public static  intLAST_WEEK_IN_MONTH
     A useful constant for referring to the last week in a month.
final static  int[]LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_MONTH
     The number of days in a leap year up to the end of each month.
final static  int[]LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH
     The number of days in a leap year up to the end of the preceding month.
final public static  intMAXIMUM_YEAR_SUPPORTED
     The highest year value supported by this date format.
final public static  intMINIMUM_YEAR_SUPPORTED
     The lowest year value supported by this date format.
final public static  intMONDAY
     Useful constant for Monday.
final public static  intNEAREST
     Useful constant for specifying a day of the week relative to a fixed date.
final public static  intPRECEDING
     Useful constant for specifying a day of the week relative to a fixed date.
final public static  intSATURDAY
     Useful constant for Saturday.
final public static  intSECOND_WEEK_IN_MONTH
     A useful constant for referring to the second week in a month.
final public static  intSERIAL_LOWER_BOUND
     The serial number for 1 January 1900.
final public static  intSERIAL_UPPER_BOUND
     The serial number for 31 December 9999.
final public static  intSUNDAY
     Useful constant for Sunday.
final public static  intTHIRD_WEEK_IN_MONTH
     A useful constant for referring to the third week in a month.
final public static  intTHURSDAY
     Useful constant for Thrusday.
final public static  intTUESDAY
     Useful constant for Tuesday.
final public static  intWEDNESDAY
     Useful constant for Wednesday.

Constructor Summary
protected  SerialDate()
     Default constructor.

Method Summary
public static  SerialDateaddDays(int days, SerialDate base)
     Creates a new date by adding the specified number of days to the base date.
Parameters:
  days - the number of days to add (can be negative).
Parameters:
  base - the base date.
public static  SerialDateaddMonths(int months, SerialDate base)
     Creates a new date by adding the specified number of months to the base date.

If the base date is close to the end of the month, the day on the result may be adjusted slightly: 31 May + 1 month = 30 June.
Parameters:
  months - the number of months to add (can be negative).
Parameters:
  base - the base date.

public static  SerialDateaddYears(int years, SerialDate base)
     Creates a new date by adding the specified number of years to the base date.
Parameters:
  years - the number of years to add (can be negative).
Parameters:
  base - the base date.
abstract public  intcompare(SerialDate other)
     Returns the difference (in days) between this date and the specified 'other' date.

The result is positive if this date is after the 'other' date and negative if it is before the 'other' date.
Parameters:
  other - the date being compared to.

public static  SerialDatecreateInstance(int day, int month, int yyyy)
     Factory method that returns an instance of some concrete subclass of SerialDate .
Parameters:
  day - the day (1-31).
Parameters:
  month - the month (1-12).
Parameters:
  yyyy - the year (in the range 1900 to 9999).
public static  SerialDatecreateInstance(int serial)
     Factory method that returns an instance of some concrete subclass of SerialDate .
Parameters:
  serial - the serial number for the day (1 January 1900 = 2).
public static  SerialDatecreateInstance(java.util.Date date)
     Factory method that returns an instance of a subclass of SerialDate.
Parameters:
  date - A Java date object.
abstract public  intgetDayOfMonth()
     Returns the day of the month.
abstract public  intgetDayOfWeek()
     Returns the day of the week.
public  StringgetDescription()
     Returns the description that is attached to the date.
public  SerialDategetEndOfCurrentMonth(SerialDate base)
     Rolls the date forward to the last day of the month.
Parameters:
  base - the base date.
public static  SerialDategetFollowingDayOfWeek(int targetWeekday, SerialDate base)
     Returns the earliest date that falls on the specified day-of-the-week and is AFTER the base date.
Parameters:
  targetWeekday - a code for the target day-of-the-week.
Parameters:
  base - the base date.
public  SerialDategetFollowingDayOfWeek(int targetDOW)
     Returns the earliest date that falls on the specified day-of-the-week and is AFTER this date.
Parameters:
  targetDOW - a code for the target day-of-the-week.
abstract public  intgetMonth()
     Returns the month (January = 1, February = 2, March = 3).
public static  String[]getMonths()
     Returns an array of month names.
public static  String[]getMonths(boolean shortened)
     Returns an array of month names.
Parameters:
  shortened - a flag indicating that shortened month names should be returned.
public static  SerialDategetNearestDayOfWeek(int targetDOW, SerialDate base)
     Returns the date that falls on the specified day-of-the-week and is CLOSEST to the base date.
Parameters:
  targetDOW - a code for the target day-of-the-week.
Parameters:
  base - the base date.
public  SerialDategetNearestDayOfWeek(int targetDOW)
     Returns the nearest date that falls on the specified day-of-the-week.
Parameters:
  targetDOW - a code for the target day-of-the-week.
public static  SerialDategetPreviousDayOfWeek(int targetWeekday, SerialDate base)
     Returns the latest date that falls on the specified day-of-the-week and is BEFORE the base date.
Parameters:
  targetWeekday - a code for the target day-of-the-week.
Parameters:
  base - the base date.
public  SerialDategetPreviousDayOfWeek(int targetDOW)
     Returns the latest date that falls on the specified day-of-the-week and is BEFORE this date.
Parameters:
  targetDOW - a code for the target day-of-the-week.
abstract public  intgetYYYY()
     Returns the year (assume a valid range of 1900 to 9999).
abstract public  booleanisAfter(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
abstract public  booleanisBefore(SerialDate other)
     Returns true if this SerialDate represents an earlier date compared to the specified SerialDate.
Parameters:
  other - The date being compared to.
abstract public  booleanisInRange(SerialDate d1, SerialDate d2)
     Returns true if this SerialDate is within the specified range (INCLUSIVE).
abstract public  booleanisInRange(SerialDate d1, SerialDate d2, int include)
     Returns true if this SerialDate is within the specified range (caller specifies whether or not the end-points are included).
public static  booleanisLeapYear(int yyyy)
     Determines whether or not the specified year is a leap year.
Parameters:
  yyyy - the year (in the range 1900 to 9999).
abstract public  booleanisOn(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
abstract public  booleanisOnOrAfter(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
abstract public  booleanisOnOrBefore(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
public static  booleanisValidMonthCode(int code)
     Returns true if the supplied integer code represents a valid month.
Parameters:
  code - the code being checked for validity.
public static  booleanisValidWeekInMonthCode(int code)
     Returns true if the supplied integer code represents a valid week-in-the-month, and false otherwise.
Parameters:
  code - the code being checked for validity.
public static  booleanisValidWeekdayCode(int code)
     Returns true if the supplied integer code represents a valid day-of-the-week, and false otherwise.
Parameters:
  code - the code being checked for validity.
public static  intlastDayOfMonth(int month, int yyyy)
     Returns the number of the last day of the month, taking into account leap years.
Parameters:
  month - the month.
Parameters:
  yyyy - the year (in the range 1900 to 9999).
public static  intleapYearCount(int yyyy)
     Returns the number of leap years from 1900 to the specified year INCLUSIVE.

Note that 1900 is not a leap year.
Parameters:
  yyyy - the year (in the range 1900 to 9999).

public static  intmonthCodeToQuarter(int code)
     Returns the quarter for the specified month.
Parameters:
  code - the month code (1-12).
public static  StringmonthCodeToString(int month)
     Returns a string representing the supplied month.

The string returned is the long form of the month name taken from the default locale.
Parameters:
  month - the month.

public static  StringmonthCodeToString(int month, boolean shortened)
     Returns a string representing the supplied month.

The string returned is the long or short form of the month name taken from the default locale.
Parameters:
  month - the month.
Parameters:
  shortened - if true return the abbreviation of the month.

public static  StringrelativeToString(int relative)
     Returns a string representing the supplied 'relative'.

Need to find a better approach.
Parameters:
  relative - a constant representing the 'relative'.

public  voidsetDescription(String description)
     Sets the description for the date.
public static  intstringToMonthCode(String s)
     Converts a string to a month code.

This method will return one of the constants JANUARY, FEBRUARY, ..., DECEMBER that corresponds to the string.

public static  intstringToWeekdayCode(String s)
     Converts the supplied string to a day of the week.
Parameters:
  s - a string representing the day of the week.
abstract public  java.util.DatetoDate()
     Returns a java.util.Date.
abstract public  inttoSerial()
     Returns the serial number for the date, where 1 January 1900 = 2 (this corresponds, almost, to the numbering system used in Microsoft Excel for Windows and Lotus 1-2-3).
public  StringtoString()
     Converts the date to a string.
public static  StringweekInMonthToString(int count)
     Returns a string corresponding to the week-in-the-month code.

Need to find a better approach.
Parameters:
  count - an integer code representing the week-in-the-month.

public static  StringweekdayCodeToString(int weekday)
     Returns a string representing the supplied day-of-the-week.

Need to find a better approach.
Parameters:
  weekday - the day of the week.


Field Detail
AGGREGATE_DAYS_TO_END_OF_MONTH
final static int[] AGGREGATE_DAYS_TO_END_OF_MONTH(Code)
The number of days in a (non-leap) year up to the end of each month.



AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH
final static int[] AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH(Code)
The number of days in a year up to the end of the preceding month.



DATE_FORMAT_SYMBOLS
final public static DateFormatSymbols DATE_FORMAT_SYMBOLS(Code)
Date format symbols.



FIRST_WEEK_IN_MONTH
final public static int FIRST_WEEK_IN_MONTH(Code)
A useful constant for referring to the first week in a month.



FOLLOWING
final public static int FOLLOWING(Code)
Useful constant for specifying a day of the week relative to a fixed date.



FOURTH_WEEK_IN_MONTH
final public static int FOURTH_WEEK_IN_MONTH(Code)
A useful constant for referring to the fourth week in a month.



FRIDAY
final public static int FRIDAY(Code)
Useful constant for Friday. Equivalent to java.util.Calendar.FRIDAY.



INCLUDE_BOTH
final public static int INCLUDE_BOTH(Code)
Useful range constant.



INCLUDE_FIRST
final public static int INCLUDE_FIRST(Code)
Useful range constant.



INCLUDE_NONE
final public static int INCLUDE_NONE(Code)
Useful range constant.



INCLUDE_SECOND
final public static int INCLUDE_SECOND(Code)
Useful range constant.



LAST_DAY_OF_MONTH
final static int[] LAST_DAY_OF_MONTH(Code)
The number of days in each month in non leap years.



LAST_WEEK_IN_MONTH
final public static int LAST_WEEK_IN_MONTH(Code)
A useful constant for referring to the last week in a month.



LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_MONTH
final static int[] LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_MONTH(Code)
The number of days in a leap year up to the end of each month.



LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH
final static int[] LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH(Code)
The number of days in a leap year up to the end of the preceding month.



MAXIMUM_YEAR_SUPPORTED
final public static int MAXIMUM_YEAR_SUPPORTED(Code)
The highest year value supported by this date format.



MINIMUM_YEAR_SUPPORTED
final public static int MINIMUM_YEAR_SUPPORTED(Code)
The lowest year value supported by this date format.



MONDAY
final public static int MONDAY(Code)
Useful constant for Monday. Equivalent to java.util.Calendar.MONDAY.



NEAREST
final public static int NEAREST(Code)
Useful constant for specifying a day of the week relative to a fixed date.



PRECEDING
final public static int PRECEDING(Code)
Useful constant for specifying a day of the week relative to a fixed date.



SATURDAY
final public static int SATURDAY(Code)
Useful constant for Saturday. Equivalent to java.util.Calendar.SATURDAY.



SECOND_WEEK_IN_MONTH
final public static int SECOND_WEEK_IN_MONTH(Code)
A useful constant for referring to the second week in a month.



SERIAL_LOWER_BOUND
final public static int SERIAL_LOWER_BOUND(Code)
The serial number for 1 January 1900.



SERIAL_UPPER_BOUND
final public static int SERIAL_UPPER_BOUND(Code)
The serial number for 31 December 9999.



SUNDAY
final public static int SUNDAY(Code)
Useful constant for Sunday. Equivalent to java.util.Calendar.SUNDAY.



THIRD_WEEK_IN_MONTH
final public static int THIRD_WEEK_IN_MONTH(Code)
A useful constant for referring to the third week in a month.



THURSDAY
final public static int THURSDAY(Code)
Useful constant for Thrusday. Equivalent to java.util.Calendar.THURSDAY.



TUESDAY
final public static int TUESDAY(Code)
Useful constant for Tuesday. Equivalent to java.util.Calendar.TUESDAY.



WEDNESDAY
final public static int WEDNESDAY(Code)
Useful constant for Wednesday. Equivalent to java.util.Calendar.WEDNESDAY.




Constructor Detail
SerialDate
protected SerialDate()(Code)
Default constructor.




Method Detail
addDays
public static SerialDate addDays(int days, SerialDate base)(Code)
Creates a new date by adding the specified number of days to the base date.
Parameters:
  days - the number of days to add (can be negative).
Parameters:
  base - the base date. a new date.



addMonths
public static SerialDate addMonths(int months, SerialDate base)(Code)
Creates a new date by adding the specified number of months to the base date.

If the base date is close to the end of the month, the day on the result may be adjusted slightly: 31 May + 1 month = 30 June.
Parameters:
  months - the number of months to add (can be negative).
Parameters:
  base - the base date. a new date.




addYears
public static SerialDate addYears(int years, SerialDate base)(Code)
Creates a new date by adding the specified number of years to the base date.
Parameters:
  years - the number of years to add (can be negative).
Parameters:
  base - the base date. A new date.



compare
abstract public int compare(SerialDate other)(Code)
Returns the difference (in days) between this date and the specified 'other' date.

The result is positive if this date is after the 'other' date and negative if it is before the 'other' date.
Parameters:
  other - the date being compared to. the difference between this and the other date.




createInstance
public static SerialDate createInstance(int day, int month, int yyyy)(Code)
Factory method that returns an instance of some concrete subclass of SerialDate .
Parameters:
  day - the day (1-31).
Parameters:
  month - the month (1-12).
Parameters:
  yyyy - the year (in the range 1900 to 9999). An instance of SerialDate.



createInstance
public static SerialDate createInstance(int serial)(Code)
Factory method that returns an instance of some concrete subclass of SerialDate .
Parameters:
  serial - the serial number for the day (1 January 1900 = 2). a instance of SerialDate.



createInstance
public static SerialDate createInstance(java.util.Date date)(Code)
Factory method that returns an instance of a subclass of SerialDate.
Parameters:
  date - A Java date object. a instance of SerialDate.



getDayOfMonth
abstract public int getDayOfMonth()(Code)
Returns the day of the month. the day of the month.



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



getDescription
public String getDescription()(Code)
Returns the description that is attached to the date. It is not required that a date have a description, but for some applications it is useful. The description (possibly null).



getEndOfCurrentMonth
public SerialDate getEndOfCurrentMonth(SerialDate base)(Code)
Rolls the date forward to the last day of the month.
Parameters:
  base - the base date. a new serial date.



getFollowingDayOfWeek
public static SerialDate getFollowingDayOfWeek(int targetWeekday, SerialDate base)(Code)
Returns the earliest date that falls on the specified day-of-the-week and is AFTER the base date.
Parameters:
  targetWeekday - a code for the target day-of-the-week.
Parameters:
  base - the base date. the earliest date that falls on the specified day-of-the-week and is AFTER the base date.



getFollowingDayOfWeek
public SerialDate getFollowingDayOfWeek(int targetDOW)(Code)
Returns the earliest date that falls on the specified day-of-the-week and is AFTER this date.
Parameters:
  targetDOW - a code for the target day-of-the-week. the earliest date that falls on the specified day-of-the-weekand is AFTER this date.



getMonth
abstract public int getMonth()(Code)
Returns the month (January = 1, February = 2, March = 3). the month of the year.



getMonths
public static String[] getMonths()(Code)
Returns an array of month names. an array of month names.



getMonths
public static String[] getMonths(boolean shortened)(Code)
Returns an array of month names.
Parameters:
  shortened - a flag indicating that shortened month names should be returned. an array of month names.



getNearestDayOfWeek
public static SerialDate getNearestDayOfWeek(int targetDOW, SerialDate base)(Code)
Returns the date that falls on the specified day-of-the-week and is CLOSEST to the base date.
Parameters:
  targetDOW - a code for the target day-of-the-week.
Parameters:
  base - the base date. the date that falls on the specified day-of-the-week and is CLOSEST to the base date.



getNearestDayOfWeek
public SerialDate getNearestDayOfWeek(int targetDOW)(Code)
Returns the nearest date that falls on the specified day-of-the-week.
Parameters:
  targetDOW - a code for the target day-of-the-week. the nearest date that falls on the specified day-of-the-week.



getPreviousDayOfWeek
public static SerialDate getPreviousDayOfWeek(int targetWeekday, SerialDate base)(Code)
Returns the latest date that falls on the specified day-of-the-week and is BEFORE the base date.
Parameters:
  targetWeekday - a code for the target day-of-the-week.
Parameters:
  base - the base date. the latest date that falls on the specified day-of-the-week and is BEFORE the base date.



getPreviousDayOfWeek
public SerialDate getPreviousDayOfWeek(int targetDOW)(Code)
Returns the latest date that falls on the specified day-of-the-week and is BEFORE this date.
Parameters:
  targetDOW - a code for the target day-of-the-week. the latest date that falls on the specified day-of-the-week andis BEFORE this date.



getYYYY
abstract public int getYYYY()(Code)
Returns the year (assume a valid range of 1900 to 9999). the year.



isAfter
abstract public boolean isAfter(SerialDate other)(Code)
Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to. true if this SerialDate represents the same dateas the specified SerialDate.



isBefore
abstract public boolean isBefore(SerialDate other)(Code)
Returns true if this SerialDate represents an earlier date compared to the specified SerialDate.
Parameters:
  other - The date being compared to. true if this SerialDate represents an earlier date compared to the specified SerialDate.



isInRange
abstract public boolean isInRange(SerialDate d1, SerialDate d2)(Code)
Returns true if this SerialDate is within the specified range (INCLUSIVE). The date order of d1 and d2 is not important.
Parameters:
  d1 - a boundary date for the range.
Parameters:
  d2 - the other boundary date for the range. A boolean.



isInRange
abstract public boolean isInRange(SerialDate d1, SerialDate d2, int include)(Code)
Returns true if this SerialDate is within the specified range (caller specifies whether or not the end-points are included). The date order of d1 and d2 is not important.
Parameters:
  d1 - a boundary date for the range.
Parameters:
  d2 - the other boundary date for the range.
Parameters:
  include - a code that controls whether or not the start and end dates are included in the range. A boolean.



isLeapYear
public static boolean isLeapYear(int yyyy)(Code)
Determines whether or not the specified year is a leap year.
Parameters:
  yyyy - the year (in the range 1900 to 9999). true if the specified year is a leap year.



isOn
abstract public boolean isOn(SerialDate other)(Code)
Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to. true if this SerialDate represents the same date as the specified SerialDate.



isOnOrAfter
abstract public boolean isOnOrAfter(SerialDate other)(Code)
Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to. true if this SerialDate represents the same dateas the specified SerialDate.



isOnOrBefore
abstract public boolean isOnOrBefore(SerialDate other)(Code)
Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to. true if this SerialDate represents the same dateas the specified SerialDate.



isValidMonthCode
public static boolean isValidMonthCode(int code)(Code)
Returns true if the supplied integer code represents a valid month.
Parameters:
  code - the code being checked for validity. true if the supplied integer code represents a valid month.



isValidWeekInMonthCode
public static boolean isValidWeekInMonthCode(int code)(Code)
Returns true if the supplied integer code represents a valid week-in-the-month, and false otherwise.
Parameters:
  code - the code being checked for validity. true if the supplied integer code represents a valid week-in-the-month.



isValidWeekdayCode
public static boolean isValidWeekdayCode(int code)(Code)
Returns true if the supplied integer code represents a valid day-of-the-week, and false otherwise.
Parameters:
  code - the code being checked for validity. true if the supplied integer code represents a valid day-of-the-week, and false otherwise.



lastDayOfMonth
public static int lastDayOfMonth(int month, int yyyy)(Code)
Returns the number of the last day of the month, taking into account leap years.
Parameters:
  month - the month.
Parameters:
  yyyy - the year (in the range 1900 to 9999). the number of the last day of the month.



leapYearCount
public static int leapYearCount(int yyyy)(Code)
Returns the number of leap years from 1900 to the specified year INCLUSIVE.

Note that 1900 is not a leap year.
Parameters:
  yyyy - the year (in the range 1900 to 9999). the number of leap years from 1900 to the specified year.




monthCodeToQuarter
public static int monthCodeToQuarter(int code)(Code)
Returns the quarter for the specified month.
Parameters:
  code - the month code (1-12). the quarter that the month belongs to.



monthCodeToString
public static String monthCodeToString(int month)(Code)
Returns a string representing the supplied month.

The string returned is the long form of the month name taken from the default locale.
Parameters:
  month - the month. a string representing the supplied month.




monthCodeToString
public static String monthCodeToString(int month, boolean shortened)(Code)
Returns a string representing the supplied month.

The string returned is the long or short form of the month name taken from the default locale.
Parameters:
  month - the month.
Parameters:
  shortened - if true return the abbreviation of the month. a string representing the supplied month.




relativeToString
public static String relativeToString(int relative)(Code)
Returns a string representing the supplied 'relative'.

Need to find a better approach.
Parameters:
  relative - a constant representing the 'relative'. a string representing the supplied 'relative'.




setDescription
public void setDescription(String description)(Code)
Sets the description for the date.
Parameters:
  description - the description for this date (null permitted).



stringToMonthCode
public static int stringToMonthCode(String s)(Code)
Converts a string to a month code.

This method will return one of the constants JANUARY, FEBRUARY, ..., DECEMBER that corresponds to the string. If the string is not recognised, this method returns -1.
Parameters:
  s - the string to parse. -1 if the string is not parseable, the month of theyear otherwise.




stringToWeekdayCode
public static int stringToWeekdayCode(String s)(Code)
Converts the supplied string to a day of the week.
Parameters:
  s - a string representing the day of the week. -1 if the string is not convertable, the day of the week otherwise.



toDate
abstract public java.util.Date toDate()(Code)
Returns a java.util.Date. Since java.util.Date has more precision than SerialDate, we need to define a convention for the 'time of day'. this as java.util.Date.



toSerial
abstract public int toSerial()(Code)
Returns the serial number for the date, where 1 January 1900 = 2 (this corresponds, almost, to the numbering system used in Microsoft Excel for Windows and Lotus 1-2-3). the serial number for the date.



toString
public String toString()(Code)
Converts the date to a string. a string representation of the date.



weekInMonthToString
public static String weekInMonthToString(int count)(Code)
Returns a string corresponding to the week-in-the-month code.

Need to find a better approach.
Parameters:
  count - an integer code representing the week-in-the-month. a string corresponding to the week-in-the-month code.




weekdayCodeToString
public static String weekdayCodeToString(int weekday)(Code)
Returns a string representing the supplied day-of-the-week.

Need to find a better approach.
Parameters:
  weekday - the day of the week. a string representing the supplied day-of-the-week.




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.