gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 05:58:49 26 4
gpt4 key购买 nike

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

Year.<init>介绍

[英]Creates a new Year, based on the current system date/time.
[中]根据当前系统日期/时间创建新的一年。

代码示例

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

/**
 * Returns the year.
 *
 * @return The year.
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year in which the week falls.
 *
 * @return The year (never {@code null}).
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year in which the month falls.
 *
 * @return The year in which the month falls (as a Year object).
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year.
 *
 * @return The year.
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year in which the week falls.
 *
 * @return The year (never <code>null</code>).
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year in which the month falls.
 *
 * @return The year in which the month falls (as a Year object).
 */
public Year getYear() {
  return new Year(this.year);
}

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

/**
 * Returns the year preceding this one.
 *
 * @return The year preceding this one (or <code>null</code> if the
 *         current year is -9999).
 */
public RegularTimePeriod previous() {
  if (this.year > Year.MINIMUM_YEAR) {
    return new Year(this.year - 1);
  }
  else {
    return null;
  }
}

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

/**
 * Returns the year following this one.
 *
 * @return The year following this one (or <code>null</code> if the current
 *         year is 9999).
 */
public RegularTimePeriod next() {
  if (this.year < Year.MAXIMUM_YEAR) {
    return new Year(this.year + 1);
  }
  else {
    return null;
  }
}

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

/**
 * Returns the year following this one.
 *
 * @return The year following this one (or {@code null} if the current
 *         year is 9999).
 */
@Override
public RegularTimePeriod next() {
  if (this.year < Year.MAXIMUM_YEAR) {
    return new Year(this.year + 1);
  }
  else {
    return null;
  }
}

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

/**
 * Returns the year preceding this one.
 *
 * @return The year preceding this one (or {@code null} if the
 *         current year is -9999).
 */
@Override
public RegularTimePeriod previous() {
  if (this.year > Year.MINIMUM_YEAR) {
    return new Year(this.year - 1);
  }
  else {
    return null;
  }
}

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

/**
 * Parses the string argument as a year.
 * <P>
 * The string format is YYYY.
 *
 * @param s  a string representing the year.
 *
 * @return <code>null</code> if the string is not parseable, the year
 *         otherwise.
 */
public static Year parseYear(String s) {
  // parse the string...
  int y;
  try {
    y = Integer.parseInt(s.trim());
  }
  catch (NumberFormatException e) {
    throw new TimePeriodFormatException("Cannot parse string.");
  }
  // create the year...
  try {
    return new Year(y);
  }
  catch (IllegalArgumentException e) {
    throw new TimePeriodFormatException("Year outside valid range.");
  }
}

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

/**
 * Parses the string argument as a year.
 * <P>
 * The string format is YYYY.
 *
 * @param s  a string representing the year.
 *
 * @return {@code null} if the string is not parseable, the year
 *         otherwise.
 */
public static Year parseYear(String s) {
  // parse the string...
  int y;
  try {
    y = Integer.parseInt(s.trim());
  }
  catch (NumberFormatException e) {
    throw new TimePeriodFormatException("Cannot parse string.");
  }
  // create the year...
  try {
    return new Year(y);
  }
  catch (IllegalArgumentException e) {
    throw new TimePeriodFormatException("Year outside valid range.");
  }
}

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

series.add(new Year(1976), new Integer(0));
series.add(new Year(1977), new Integer(1));
series.add(new Year(1978), new Integer(0));
series.add(new Year(1979), new Integer(2));
series.add(new Year(1980), new Integer(0));
series.add(new Year(1981), new Integer(1));
series.add(new Year(1982), new Integer(2));
series.add(new Year(1983), new Integer(5));
series.add(new Year(1984), new Integer(21));
series.add(new Year(1985), new Integer(18));
series.add(new Year(1986), new Integer(18));
series.add(new Year(1987), new Integer(25));
series.add(new Year(1988), new Integer(11));
series.add(new Year(1989), new Integer(16));
series.add(new Year(1990), new Integer(23));
series.add(new Year(1991), new Integer(14));
series.add(new Year(1992), new Integer(31));
series.add(new Year(1993), new Integer(38));
series.add(new Year(1994), new Integer(31));
series.add(new Year(1995), new Integer(56));
series.add(new Year(1996), new Integer(45));
series.add(new Year(1997), new Integer(74));
series.add(new Year(1998), new Integer(68));
series.add(new Year(1999), new Integer(98));
series.add(new Year(2000), new Integer(85));
series.add(new Year(2001), new Integer(66));
series.add(new Year(2002), new Integer(71));
series.add(new Year(2003), new Integer(65));
series.add(new Year(2004), new Integer(59));

代码示例来源:origin: ssaring/sportstracker

/**
 * Creates the TimePeriod to be displayed in the TimeSeries graph for the
 * specified time step.
 *
 * @param timeType the time range type to be displayed
 * @param year the year to be displayed
 * @param timeStep the current time step in the graph
 * @return the created TimePeriod for the current time step
 */
private RegularTimePeriod createTimePeriodForTimeStep(TimeRangeType timeType, int year, int timeStep) {
  switch (timeType) {
    case LAST_12_MONTHS:
      LocalDate now = LocalDate.now();
      int tempMonth = now.getMonthValue() + timeStep - 1;
      int tempYear = now.getYear() - 1 + tempMonth / 12;
      return new Month(tempMonth % 12 + 1, tempYear);
    case MONTHS_OF_YEAR:
      return new Month(timeStep + 1, year);
    case WEEKS_OF_YEAR:
      // Workaround for a JFreeChart problem: use the Year instead
      // of Week class for the botton axis, otherwise there will be
      // format problems on the axis (the first week is often "52")
      int tempWeekNr = timeStep + 1;
      return new Year(1900 + tempWeekNr);
    case LAST_10_YEARS:
      return new Year(year - 9 + timeStep);
    default:
      throw new IllegalArgumentException("Unknow TimeRangeType!");
  }
}

代码示例来源:origin: org.activecomponents.jadex/jadex-applications-micro

t= new Year(new Date(((Number)valx).longValue()));

代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

t= new Year(new Date(((Number)valx).longValue()));

代码示例来源:origin: org.arrahtec/osdq-core

dataset.addOrUpdate(new Year((Date)dcell) , new Double(ncell.toString()));
  break;
case 1: //Quarter

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

break;
case(DateTickUnit.YEAR) :
  result = calculateDateForPosition(new Year(time,
      this.timeZone, this.locale), position);
  break;

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

c.set(Calendar.MILLISECOND, 0);
if(org.jfree.data.time.Year.class.equals(periodGrouping)) {
  return new org.jfree.data.time.Year(c.getTime());
}else if(org.jfree.data.time.Month.class.equals(periodGrouping)) {
  return new org.jfree.data.time.Month(c.getTime());

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

/**
 * Corrects the given tick date for the position setting.
 *
 * @param time  the tick date/time.
 * @param unit  the tick unit.
 * @param position  the tick position.
 *
 * @return The adjusted time.
 */
private Date correctTickDateForPosition(Date time, DateTickUnit unit,
    DateTickMarkPosition position) {
  Date result = time;
  if (unit.getUnitType().equals(DateTickUnitType.MONTH)) {
    result = calculateDateForPosition(new Month(time, this.timeZone,
        this.locale), position);
  } else if (unit.getUnitType().equals(DateTickUnitType.YEAR)) {
    result = calculateDateForPosition(new Year(time, this.timeZone,
        this.locale), position);
  }
  return result;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com