gpt4 book ai didi

org.joda.time.Years.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 16:56:40 26 4
gpt4 key购买 nike

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

Years.<init>介绍

[英]Creates a new instance representing a number of years. You should consider using the factory method #years(int)instead of the constructor.
[中]创建表示年份的新实例。您应该考虑使用工厂方法年(int)而不是构造函数。

代码示例

代码示例来源:origin: JodaOrg/joda-time

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: joda-time/joda-time

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

代码示例来源:origin: Nextdoor/bender

/**
 * Obtains an instance of <code>Years</code> that may be cached.
 * <code>Years</code> is immutable, so instances can be cached and shared.
 * This factory method provides access to shared instances.
 *
 * @param years  the number of years to obtain an instance for
 * @return the instance of Years
 */
public static Years years(int years) {
  switch (years) {
    case 0:
      return ZERO;
    case 1:
      return ONE;
    case 2:
      return TWO;
    case 3:
      return THREE;
    case Integer.MAX_VALUE:
      return MAX_VALUE;
    case Integer.MIN_VALUE:
      return MIN_VALUE;
    default:
      return new Years(years);
  }
}

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