Tabnine Logo
org.jfree.date
Code IndexAdd Tabnine to your IDE (free)

How to use org.jfree.date

Best Java code snippets using org.jfree.date (Showing top 20 results out of 315)

origin: jfree/jcommon

/**
 * Creates a clone of this rule.
 *
 * @return a clone of this rule.
 *
 * @throws CloneNotSupportedException this should never happen.
 */
public Object clone() throws CloneNotSupportedException {
  final RelativeDayOfWeekRule duplicate 
    = (RelativeDayOfWeekRule) super.clone();
  duplicate.subrule = (AnnualDateRule) duplicate.getSubrule().clone();
  return duplicate;
}
origin: jfree/jcommon

/**
 * Implements the method required by the Comparable interface.
 * 
 * @param other  the other object (usually another SerialDate).
 * 
 * @return A negative integer, zero, or a positive integer as this object 
 *         is less than, equal to, or greater than the specified object.
 */
public int compareTo(final Object other) {
  return compare((SerialDate) other);    
}
 
origin: jfree/jcommon

/**
 * Factory method that returns an instance of some concrete subclass of 
 * {@link SerialDate}.
 *
 * @param serial  the serial number for the day (1 January 1900 = 2).
 *
 * @return a instance of SerialDate.
 */
public static SerialDate createInstance(final int serial) {
  return new SpreadsheetDate(serial);
}
origin: org.jfree/jcommon

/**
 * Converts the date to a string.
 *
 * @return  a string representation of the date.
 */
public String toString() {
  return getDayOfMonth() + "-" + SerialDate.monthCodeToString(getMonth())
              + "-" + getYYYY();
}
origin: org.jfree/jcommon

/**
 * Returns true if this SerialDate represents the same date as the
 * specified SerialDate.
 *
 * @param other  the date being compared to.
 *
 * @return <code>true</code> if this SerialDate represents the same date
 *         as the specified SerialDate.
 */
public boolean isAfter(final SerialDate other) {
  return (this.serial > other.toSerial());
}
origin: jfree/jcommon

/**
 * Returns the actual number of days between two dates.
 *
 * @param start  the start date.
 * @param end  the end date.
 *
 * @return the number of days between the start date and the end date.
 */
public static int dayCountActual(final SerialDate start, final SerialDate end) {
  return end.compare(start);
}
origin: org.jfree/jcommon

  /**
   * Returns the date, given the year.
   *
   * @param yyyy  the year.
   *
   * @return the date generated by this rule for the specified year (null permitted).
   */
  public SerialDate getDate(final int yyyy) {
    return SerialDate.createInstance(this.dayOfMonth, this.month, yyyy);
  }
}
origin: jfree/jcommon

/**
 * Default constructor - builds a rule for the Monday following 1 January.
 */
public RelativeDayOfWeekRule() {
  this(new DayAndMonthRule(), SerialDate.MONDAY, SerialDate.FOLLOWING);
}
origin: org.jfree/jcommon

/**
 * Returns the latest date that falls on the specified day-of-the-week and
 * is BEFORE this date.
 *
 * @param targetDOW  a code for the target day-of-the-week.
 *
 * @return the latest date that falls on the specified day-of-the-week and
 *         is BEFORE this date.
 */
public SerialDate getPreviousDayOfWeek(final int targetDOW) {
  return getPreviousDayOfWeek(targetDOW, this);
}
origin: org.jfree/jcommon

/**
 * Returns the nearest date that falls on the specified day-of-the-week.
 *
 * @param targetDOW  a code for the target day-of-the-week.
 *
 * @return the nearest date that falls on the specified day-of-the-week.
 */
public SerialDate getNearestDayOfWeek(final int targetDOW) {
  return getNearestDayOfWeek(targetDOW, this);
}
origin: jfree/jcommon

/**
 * Returns an array of month names.
 *
 * @return an array of month names.
 */
public static String[] getMonths() {
  return getMonths(false);
}
origin: jfree/jcommon

/**
 * Converts the date to a string.
 *
 * @return  a string representation of the date.
 */
public String toString() {
  return getDayOfMonth() + "-" + SerialDate.monthCodeToString(getMonth())
              + "-" + getYYYY();
}
origin: org.jfree/jcommon

/**
 * Creates a clone of this rule.
 *
 * @return a clone of this rule.
 *
 * @throws CloneNotSupportedException this should never happen.
 */
public Object clone() throws CloneNotSupportedException {
  final RelativeDayOfWeekRule duplicate 
    = (RelativeDayOfWeekRule) super.clone();
  duplicate.subrule = (AnnualDateRule) duplicate.getSubrule().clone();
  return duplicate;
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Returns true if this SerialDate represents the same date as the
 * specified SerialDate.
 *
 * @param other  the date being compared to.
 *
 * @return <code>true</code> if this SerialDate represents the same date
 *         as the specified SerialDate.
 */
public boolean isAfter(final SerialDate other) {
  return (this.serial > other.toSerial());
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Returns the actual number of days between two dates.
 *
 * @param start  the start date.
 * @param end  the end date.
 *
 * @return the number of days between the start date and the end date.
 */
public static int dayCountActual(final SerialDate start, final SerialDate end) {
  return end.compare(start);
}
origin: org.jfree/jcommon

/**
 * Default constructor - builds a rule for the Monday following 1 January.
 */
public RelativeDayOfWeekRule() {
  this(new DayAndMonthRule(), SerialDate.MONDAY, SerialDate.FOLLOWING);
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Creates a clone of this rule.
 *
 * @return a clone of this rule.
 *
 * @throws CloneNotSupportedException this should never happen.
 */
public Object clone() throws CloneNotSupportedException {
  final RelativeDayOfWeekRule duplicate 
    = (RelativeDayOfWeekRule) super.clone();
  duplicate.subrule = (AnnualDateRule) duplicate.getSubrule().clone();
  return duplicate;
}
origin: jfree/jcommon

/**
 * Returns the difference (in days) between this date and the specified 
 * 'other' date.
 *
 * @param other  the date being compared to.
 *
 * @return The difference (in days) between this date and the specified 
 *         'other' date.
 */
public int compare(final SerialDate other) {
  return this.serial - other.toSerial();
}
origin: jfree/jcommon

/**
 * Returns true if this SerialDate represents the same date as the
 * specified SerialDate.
 *
 * @param other  the date being compared to.
 *
 * @return <code>true</code> if this SerialDate represents the same date
 *         as the specified SerialDate.
 */
public boolean isOnOrBefore(final SerialDate other) {
  return (this.serial <= other.toSerial());
}
origin: jfree/jcommon

/**
 * Returns true if this SerialDate represents the same date as the
 * specified SerialDate.
 *
 * @param other  the date being compared to.
 *
 * @return <code>true</code> if this SerialDate represents the same date
 *         as the specified SerialDate.
 */
public boolean isAfter(final SerialDate other) {
  return (this.serial > other.toSerial());
}
org.jfree.date

Most used classes

  • SerialDate
    An abstract class that defines our requirements for manipulating dates, without tying down a particu
  • AnnualDateRule
    The base class for all 'annual' date rules: that is, rules for generating one date for any given yea
  • DayAndMonthRule
    An annual date rule where the generated date always falls on the same day and month each year. An ex
  • RelativeDayOfWeekRule
    An annual date rule that returns a date for each year based on (a) a reference rule; (b) a day of th
  • SerialDateUtilities
    A utility class that provides a number of useful methods (some static). Many of these are used in th
  • DateUtilities
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now