Java Doc for SpreadsheetDate.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
      org.jfree.date.SpreadsheetDate

SpreadsheetDate
public class SpreadsheetDate extends SerialDate (Code)
Represents a date using an integer, in a similar fashion to the implementation in Microsoft Excel. The range of dates supported is 1-Jan-1900 to 31-Dec-9999.

Be aware that there is a deliberate bug in Excel that recognises the year 1900 as a leap year when in fact it is not a leap year. You can find more information on the Microsoft website in article Q181370:

http://support.microsoft.com/support/kb/articles/Q181/3/70.asp

Excel uses the convention that 1-Jan-1900 = 1. This class uses the convention 1-Jan-1900 = 2. The result is that the day number in this class will be different to the Excel figure for January and February 1900...but then Excel adds in an extra day (29-Feb-1900 which does not actually exist!) and from that point forward the day numbers will match.
author:
   David Gilbert




Constructor Summary
public  SpreadsheetDate(int day, int month, int year)
     Creates a new date instance.
public  SpreadsheetDate(int serial)
     Standard constructor - creates a new date object representing the specified day number (which should be in the range 2 to 2958465.

Method Summary
public  intcompare(SerialDate other)
     Returns the difference (in days) between this date and the specified 'other' date.
Parameters:
  other - the date being compared to.
public  intcompareTo(Object other)
     Implements the method required by the Comparable interface.
Parameters:
  other - the other object (usually another SerialDate).
public  booleanequals(Object object)
     Tests the equality of this date with an arbitrary object.

This method will return true ONLY if the object is an instance of the SerialDate base class, and it represents the same day as this SpreadsheetDate .
Parameters:
  object - the object to compare (null permitted).

public  intgetDayOfMonth()
     Returns the day of the month.
public  intgetDayOfWeek()
     Returns a code representing the day of the week.
public  intgetMonth()
     Returns the month (January = 1, February = 2, March = 3).
public  intgetYYYY()
     Returns the year (assume a valid range of 1900 to 9999).
public  inthashCode()
     Returns a hash code for this object instance.
public  booleanisAfter(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
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.
public  booleanisInRange(SerialDate d1, SerialDate d2)
     Returns true if this SerialDate is within the specified range (INCLUSIVE).
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  booleanisOn(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
public  booleanisOnOrAfter(SerialDate other)
     Returns true if this SerialDate represents the same date as the specified SerialDate.
Parameters:
  other - the date being compared to.
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  DatetoDate()
     Returns a java.util.Date equivalent to this date.
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).


Constructor Detail
SpreadsheetDate
public SpreadsheetDate(int day, int month, int year)(Code)
Creates a new date instance.
Parameters:
  day - the day (in the range 1 to 28/29/30/31).
Parameters:
  month - the month (in the range 1 to 12).
Parameters:
  year - the year (in the range 1900 to 9999).



SpreadsheetDate
public SpreadsheetDate(int serial)(Code)
Standard constructor - creates a new date object representing the specified day number (which should be in the range 2 to 2958465.
Parameters:
  serial - the serial number for the day (range: 2 to 2958465).




Method Detail
compare
public int compare(SerialDate other)(Code)
Returns the difference (in days) between this date and the specified 'other' date.
Parameters:
  other - the date being compared to. The difference (in days) between this date and the specified 'other' date.



compareTo
public int compareTo(Object other)(Code)
Implements the method required by the Comparable interface.
Parameters:
  other - the other object (usually another SerialDate). A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.



equals
public boolean equals(Object object)(Code)
Tests the equality of this date with an arbitrary object.

This method will return true ONLY if the object is an instance of the SerialDate base class, and it represents the same day as this SpreadsheetDate .
Parameters:
  object - the object to compare (null permitted). A boolean.




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



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

The codes are defined in the SerialDate class as: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY. A code representing the day of the week.




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



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



hashCode
public int hashCode()(Code)
Returns a hash code for this object instance. A hash code.



isAfter
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
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 datecompared to the specified SerialDate.



isInRange
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
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 order of d1 and d2 is not important.
Parameters:
  d1 - one boundary date for the range.
Parameters:
  d2 - a second boundary date for the range.
Parameters:
  include - a code that controls whether or not the start and end dates are included in the range. true if this SerialDate is within the specified range.



isOn
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 asthe specified SerialDate.



isOnOrAfter
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 date asthe specified SerialDate.



isOnOrBefore
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.



toDate
public Date toDate()(Code)
Returns a java.util.Date equivalent to this date. The date.



toSerial
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 of this date.



Fields inherited from org.jfree.date.SerialDate
final static int[] AGGREGATE_DAYS_TO_END_OF_MONTH(Code)(Java Doc)
final static int[] AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH(Code)(Java Doc)
final public static DateFormatSymbols DATE_FORMAT_SYMBOLS(Code)(Java Doc)
final public static int FIRST_WEEK_IN_MONTH(Code)(Java Doc)
final public static int FOLLOWING(Code)(Java Doc)
final public static int FOURTH_WEEK_IN_MONTH(Code)(Java Doc)
final public static int FRIDAY(Code)(Java Doc)
final public static int INCLUDE_BOTH(Code)(Java Doc)
final public static int INCLUDE_FIRST(Code)(Java Doc)
final public static int INCLUDE_NONE(Code)(Java Doc)
final public static int INCLUDE_SECOND(Code)(Java Doc)
final static int[] LAST_DAY_OF_MONTH(Code)(Java Doc)
final public static int LAST_WEEK_IN_MONTH(Code)(Java Doc)
final static int[] LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_MONTH(Code)(Java Doc)
final static int[] LEAP_YEAR_AGGREGATE_DAYS_TO_END_OF_PRECEDING_MONTH(Code)(Java Doc)
final public static int MAXIMUM_YEAR_SUPPORTED(Code)(Java Doc)
final public static int MINIMUM_YEAR_SUPPORTED(Code)(Java Doc)
final public static int MONDAY(Code)(Java Doc)
final public static int NEAREST(Code)(Java Doc)
final public static int PRECEDING(Code)(Java Doc)
final public static int SATURDAY(Code)(Java Doc)
final public static int SECOND_WEEK_IN_MONTH(Code)(Java Doc)
final public static int SERIAL_LOWER_BOUND(Code)(Java Doc)
final public static int SERIAL_UPPER_BOUND(Code)(Java Doc)
final public static int SUNDAY(Code)(Java Doc)
final public static int THIRD_WEEK_IN_MONTH(Code)(Java Doc)
final public static int THURSDAY(Code)(Java Doc)
final public static int TUESDAY(Code)(Java Doc)
final public static int WEDNESDAY(Code)(Java Doc)

Methods inherited from org.jfree.date.SerialDate
public static SerialDate addDays(int days, SerialDate base)(Code)(Java Doc)
public static SerialDate addMonths(int months, SerialDate base)(Code)(Java Doc)
public static SerialDate addYears(int years, SerialDate base)(Code)(Java Doc)
abstract public int compare(SerialDate other)(Code)(Java Doc)
public static SerialDate createInstance(int day, int month, int yyyy)(Code)(Java Doc)
public static SerialDate createInstance(int serial)(Code)(Java Doc)
public static SerialDate createInstance(java.util.Date date)(Code)(Java Doc)
abstract public int getDayOfMonth()(Code)(Java Doc)
abstract public int getDayOfWeek()(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public SerialDate getEndOfCurrentMonth(SerialDate base)(Code)(Java Doc)
public static SerialDate getFollowingDayOfWeek(int targetWeekday, SerialDate base)(Code)(Java Doc)
public SerialDate getFollowingDayOfWeek(int targetDOW)(Code)(Java Doc)
abstract public int getMonth()(Code)(Java Doc)
public static String[] getMonths()(Code)(Java Doc)
public static String[] getMonths(boolean shortened)(Code)(Java Doc)
public static SerialDate getNearestDayOfWeek(int targetDOW, SerialDate base)(Code)(Java Doc)
public SerialDate getNearestDayOfWeek(int targetDOW)(Code)(Java Doc)
public static SerialDate getPreviousDayOfWeek(int targetWeekday, SerialDate base)(Code)(Java Doc)
public SerialDate getPreviousDayOfWeek(int targetDOW)(Code)(Java Doc)
abstract public int getYYYY()(Code)(Java Doc)
abstract public boolean isAfter(SerialDate other)(Code)(Java Doc)
abstract public boolean isBefore(SerialDate other)(Code)(Java Doc)
abstract public boolean isInRange(SerialDate d1, SerialDate d2)(Code)(Java Doc)
abstract public boolean isInRange(SerialDate d1, SerialDate d2, int include)(Code)(Java Doc)
public static boolean isLeapYear(int yyyy)(Code)(Java Doc)
abstract public boolean isOn(SerialDate other)(Code)(Java Doc)
abstract public boolean isOnOrAfter(SerialDate other)(Code)(Java Doc)
abstract public boolean isOnOrBefore(SerialDate other)(Code)(Java Doc)
public static boolean isValidMonthCode(int code)(Code)(Java Doc)
public static boolean isValidWeekInMonthCode(int code)(Code)(Java Doc)
public static boolean isValidWeekdayCode(int code)(Code)(Java Doc)
public static int lastDayOfMonth(int month, int yyyy)(Code)(Java Doc)
public static int leapYearCount(int yyyy)(Code)(Java Doc)
public static int monthCodeToQuarter(int code)(Code)(Java Doc)
public static String monthCodeToString(int month)(Code)(Java Doc)
public static String monthCodeToString(int month, boolean shortened)(Code)(Java Doc)
public static String relativeToString(int relative)(Code)(Java Doc)
public void setDescription(String description)(Code)(Java Doc)
public static int stringToMonthCode(String s)(Code)(Java Doc)
public static int stringToWeekdayCode(String s)(Code)(Java Doc)
abstract public java.util.Date toDate()(Code)(Java Doc)
abstract public int toSerial()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public static String weekInMonthToString(int count)(Code)(Java Doc)
public static String weekdayCodeToString(int weekday)(Code)(Java Doc)

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.