org.jfree.data.time.Hour类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.jfree.data.time.Hour类的一些代码示例,展示了Hour类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hour类的具体详情如下:
包路径:org.jfree.data.time.Hour
类名称:Hour

Hour介绍

[英]Represents an hour in a specific day. This class is immutable, which is a requirement for all RegularTimePeriod subclasses.
[中]表示特定日期中的一小时。这个类是不可变的,这是所有RegularTimePeriod子类的要求。

代码示例

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the hour.
 *
 * @return The hour (never {@code null}).
 */
public Hour getHour() {
  return new Hour(this.hour, this.day);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Constructs a new Minute.
 *
 * @param minute  the minute (0 to 59).
 * @param hour  the hour (<code>null</code> not permitted).
 */
public Minute(int minute, Hour hour) {
  if (hour == null) {
    throw new IllegalArgumentException("Null 'hour' argument.");
  }
  this.minute = (byte) minute;
  this.hour = (byte) hour.getHour();
  this.day = hour.getDay();
  peg(Calendar.getInstance());
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns a string representation of this instance, for debugging
 * purposes.
 *
 * @return A string.
 */
@Override
public String toString() {
  return "[" + this.hour + "," + getDayOfMonth() + "/" + getMonth() + "/"
      + getYear() + "]";
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Recalculates the start date/time and end date/time for this time period
 * relative to the supplied calendar (which incorporates a time zone).
 *
 * @param calendar  the calendar (<code>null</code> not permitted).
 *
 * @since 1.0.3
 */
public void peg(Calendar calendar) {
  this.firstMillisecond = getFirstMillisecond(calendar);
  this.lastMillisecond = getLastMillisecond(calendar);
}

代码示例来源:origin: jfree/jfreechart

result = getHour().compareTo(m.getHour());
if (result == 0) {
  result = this.minute - m.getMinute();

代码示例来源:origin: jfree/jfreechart

/**
 * Recalculates the start date/time and end date/time for this time period
 * relative to the supplied calendar (which incorporates a time zone).
 *
 * @param calendar  the calendar ({@code null} not permitted).
 *
 * @since 1.0.3
 */
@Override
public void peg(Calendar calendar) {
  this.firstMillisecond = getFirstMillisecond(calendar);
  this.lastMillisecond = getLastMillisecond(calendar);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

result = getHour().compareTo(m.getHour());
if (result == 0) {
  result = this.minute - m.getMinute();

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the hour.
 *
 * @return The hour (never <code>null</code>).
 */
public Hour getHour() {
  return new Hour(this.hour, this.day);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a string representation of this instance, for debugging
 * purposes.
 *
 * @return A string.
 */
public String toString() {
  return "[" + this.hour + "," + getDayOfMonth() + "/" + getMonth() + "/"
      + getYear() + "]";
}

代码示例来源:origin: jfree/jfreechart

/**
 * Constructs a new Minute.
 *
 * @param minute  the minute (0 to 59).
 * @param hour  the hour ({@code null} not permitted).
 */
public Minute(int minute, Hour hour) {
  Args.nullNotPermitted(hour, "hour");
  this.minute = (byte) minute;
  this.hour = (byte) hour.getHour();
  this.day = hour.getDay();
  peg(Calendar.getInstance());
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the minute.
 *
 * @return The minute (never {@code null}).
 */
public Minute getMinute() {
  return new Minute(this.minute, new Hour(this.hour, this.day));
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

result = getDay().compareTo(h.getDay());
if (result == 0) {
  result = this.hour - h.getHour();

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the minute.
 *
 * @return The minute (never <code>null</code>).
 */
public Minute getMinute() {
  return new Minute(this.minute, new Hour(this.hour, this.day));
}

代码示例来源:origin: jfree/jfreechart

result = getDay().compareTo(h.getDay());
if (result == 0) {
  result = this.hour - h.getHour();

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the hour following this one.
 *
 * @return The hour following this one.
 */
@Override
public RegularTimePeriod next() {
  Hour result;
  if (this.hour != LAST_HOUR_IN_DAY) {
    result = new Hour(this.hour + 1, this.day);
  }
  else { // we are at the last hour in the day...
    Day nextDay = (Day) this.day.next();
    if (nextDay != null) {
      result = new Hour(FIRST_HOUR_IN_DAY, nextDay);
    }
    else {
      result = null;
    }
  }
  return result;
}

代码示例来源:origin: jfree/jfreechart

/**
 * Returns the hour preceding this one.
 *
 * @return The hour preceding this one.
 */
@Override
public RegularTimePeriod previous() {
  Hour result;
  if (this.hour != FIRST_HOUR_IN_DAY) {
    result = new Hour(this.hour - 1, this.day);
  }
  else { // we are at the first hour in the day...
    Day prevDay = (Day) this.day.previous();
    if (prevDay != null) {
      result = new Hour(LAST_HOUR_IN_DAY, prevDay);
    }
    else {
      result = null;
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the hour preceding this one.
 *
 * @return The hour preceding this one.
 */
public RegularTimePeriod previous() {
  Hour result;
  if (this.hour != FIRST_HOUR_IN_DAY) {
    result = new Hour(this.hour - 1, this.day);
  }
  else { // we are at the first hour in the day...
    Day prevDay = (Day) this.day.previous();
    if (prevDay != null) {
      result = new Hour(LAST_HOUR_IN_DAY, prevDay);
    }
    else {
      result = null;
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the hour following this one.
 *
 * @return The hour following this one.
 */
public RegularTimePeriod next() {
  Hour result;
  if (this.hour != LAST_HOUR_IN_DAY) {
    result = new Hour(this.hour + 1, this.day);
  }
  else { // we are at the last hour in the day...
    Day nextDay = (Day) this.day.next();
    if (nextDay != null) {
      result = new Hour(FIRST_HOUR_IN_DAY, nextDay);
    }
    else {
      result = null;
    }
  }
  return result;
}

代码示例来源:origin: org.openfuxml/ofx-chart

protected RegularTimePeriod getRtp(Date d)
{
  RegularTimePeriod rtp;
  switch(ofxTimePeriod)
  {
    case Hour: rtp = new Hour(d);break;
    case Day: rtp = new Day(d);break;
    case Month: rtp = new Month(d);break;
    default: rtp = new Hour(d);break;
  }
  return rtp;
}

代码示例来源:origin: org.openfuxml/ofx-chart

protected RegularTimePeriod getRtp(Date d)
{
  RegularTimePeriod rtp;
  switch(ofxTimePeriod)
  {
    case Hour: rtp = new Hour(d);break;
    case Day: rtp = new Day(d);break;
    case Month: rtp = new Month(d);break;
    default: rtp = new Hour(d);break;
  }
  return rtp;
}

相关文章