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

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

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

Hour.peg介绍

[英]Recalculates the start date/time and end date/time for this time period relative to the supplied calendar (which incorporates a time zone).
[中]相对于提供的日历(包含时区),重新计算此时间段的开始日期/时间和结束日期/时间。

代码示例

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

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

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

/**
 * Constructs a new Hour.
 *
 * @param hour  the hour (in the range 0 to 23).
 * @param day  the day ({@code null} not permitted).
 */
public Hour(int hour, Day day) {
  Args.nullNotPermitted(day, "day");
  this.hour = (byte) hour;
  this.day = day;
  peg(Calendar.getInstance());
}

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

/**
 * Constructs a new instance, based on the supplied date/time evaluated
 * in the specified time zone.
 *
 * @param time  the date-time (<code>null</code> not permitted).
 * @param zone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public Hour(Date time, TimeZone zone, Locale locale) {
  if (time == null) {
    throw new IllegalArgumentException("Null 'time' argument.");
  }
  if (zone == null) {
    throw new IllegalArgumentException("Null 'zone' argument.");
  }
  if (locale == null) {
    throw new IllegalArgumentException("Null 'locale' argument.");
  }
  Calendar calendar = Calendar.getInstance(zone, locale);
  calendar.setTime(time);
  this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY);
  this.day = new Day(time, zone, locale);
  peg(calendar);
}

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

/**
 * Constructs a new instance, based on the supplied date/time evaluated
 * in the specified time zone.
 *
 * @param time  the date-time ({@code null} not permitted).
 * @param zone  the time zone ({@code null} not permitted).
 * @param locale  the locale ({@code null} not permitted).
 *
 * @since 1.0.13
 */
public Hour(Date time, TimeZone zone, Locale locale) {
  Args.nullNotPermitted(time, "time");
  Args.nullNotPermitted(zone, "zone");
  Args.nullNotPermitted(locale, "locale");
  Calendar calendar = Calendar.getInstance(zone, locale);
  calendar.setTime(time);
  this.hour = (byte) calendar.get(Calendar.HOUR_OF_DAY);
  this.day = new Day(time, zone, locale);
  peg(calendar);
}

相关文章