org.jfree.data.time.Hour.<init>()方法的使用及代码示例

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

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

Hour.<init>介绍

[英]Constructs a new Hour, based on the system date/time.
[中]根据系统日期/时间构造新的小时。

代码示例

代码示例来源: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: jfree/jfreechart

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

代码示例来源: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

/**
 * 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

/**
 * 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: 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: 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 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;
}

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

public synchronized static RegularTimePeriod getRtp(OfxChartTimePeriod ofxTimePeriod, 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: jfree/jfreechart

/**
 * Creates an Hour instance by parsing a string.  The string is assumed to
 * be in the format "YYYY-MM-DD HH", perhaps with leading or trailing
 * whitespace.
 *
 * @param s  the hour string to parse.
 *
 * @return {@code null} if the string is not parseable, the hour
 *         otherwise.
 */
public static Hour parseHour(String s) {
  Hour result = null;
  s = s.trim();
  String daystr = s.substring(0, Math.min(10, s.length()));
  Day day = Day.parseDay(daystr);
  if (day != null) {
    String hourstr = s.substring(
      Math.min(daystr.length() + 1, s.length()), s.length()
    );
    hourstr = hourstr.trim();
    int hour = Integer.parseInt(hourstr);
    // if the hour is 0 - 23 then create an hour
    if ((hour >= FIRST_HOUR_IN_DAY) && (hour <= LAST_HOUR_IN_DAY)) {
      result = new Hour(hour, day);
    }
  }
  return result;
}

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

int minute = Integer.parseInt(minstr);
if ((minute >= 0) && (minute <= 59)) {
  result = new Minute(minute, new Hour(hour, day));

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

/**
 * Creates a new minute.
 *
 * @param minute  the minute (0-59).
 * @param hour  the hour (0-23).
 * @param day  the day (1-31).
 * @param month  the month (1-12).
 * @param year  the year (1900-9999).
 */
public Minute(int minute, int hour, int day, int month, int year) {
  this(minute, new Hour(hour, new Day(day, month, year)));
}

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

if ((minute >= 0) && (minute <= 59)) {
  Minute m = new Minute(minute, new Hour(hour, day));
  int second = Integer.parseInt(secstr);
  if ((second >= 0) && (second <= 59)) {

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

/**
 * Creates a new minute.
 *
 * @param minute  the minute (0-59).
 * @param hour  the hour (0-23).
 * @param day  the day (1-31).
 * @param month  the month (1-12).
 * @param year  the year (1900-9999).
 */
public Minute(int minute, int hour, int day, int month, int year) {
  this(minute, new Hour(hour, new Day(day, month, year)));
}

代码示例来源:origin: org.n52.series-api/io

private RegularTimePeriod determineTimeInterval(Date date, StyleProperties styleProperties) {
  if (styleProperties.getProperties()
            .containsKey(Style.PARAMETER_INTERVAL)) {
    String interval = styleProperties.getProperties()
                     .get(Style.PARAMETER_INTERVAL);
    if (interval.equals(Style.VALUE_INTERVAL_BY_HOUR)) {
      return new Hour(date);
    } else if (interval.equals(Style.VALUE_INTERVAL_BY_DAY)) {
      return new Day(date);
    } else if (interval.equals(Style.VALUE_INTERVAL_BY_MONTH)) {
      return new Month(date);
    }
  }
  return new Week(date);
}

代码示例来源:origin: org.n52.sensorweb/timeseries-io

private RegularTimePeriod determineTimeInterval(Date date, StyleProperties styleProperties) {
  if (styleProperties.getProperties().containsKey("interval")) {
    String interval = styleProperties.getProperties().get("interval");
    if (interval.equals("byHour")) {
      return new Hour(date);
    }
    else if (interval.equals("byDay")) {
      return new Day(date);
    }
    else if (interval.equals("byMonth")) {
      return new Month(date);
    }
  }
  return new Week(date);
}

代码示例来源:origin: jasperreports/jasperreports

Minute m0 = new Minute(0, new Hour(i, today));
Minute m1 = new Minute(15, new Hour(i, today));
Minute m2 = new Minute(30, new Hour(i, today));
Minute m3 = new Minute(45, new Hour(i, today));
Minute m4 = new Minute(0, new Hour(i + 1, today));
series1.add(new SimpleTimePeriod(m0.getStart(), m1.getStart()), Math.random());
series2.add(new SimpleTimePeriod(m1.getStart(), m2.getStart()), Math.random());

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

private IntervalXYDataset createDataset(List<DataSet> lContainer)
  {
    TimeSeriesCollection dataset = new TimeSeriesCollection();
    for(DataSet container : lContainer)
    {
      TimeSeries ts = new TimeSeries(container.getLabel());
      for(Data data : container.getData())
      {
          Date d = DateUtil.getDateFromInt(data.getRecord().getYear(), data.getRecord().getMonth(), data.getRecord().getDay());
          ts.addOrUpdate(new Hour(d), data.getY());
      }
       dataset.addSeries(ts);
    }
    return dataset;
  }
}

相关文章