gpt4 book ai didi

org.jooq.types.YearToMonth.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 03:39:31 30 4
gpt4 key购买 nike

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

YearToMonth.<init>介绍

[英]Create a new year-month interval.
[中]创建一个新年-月份间隔。

代码示例

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

@Override
public final YearToMonth neg() {
  return new YearToMonth(years, months, !negative);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final YearToMonth abs() {
  return new YearToMonth(years, months, false);
}

代码示例来源:origin: org.jooq/jooq

@Override
public final YearToMonth neg() {
  return new YearToMonth(years, months, !negative);
}

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

@Override
public final YearToMonth abs() {
  return new YearToMonth(years, months, false);
}

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

/**
 * Parse a string representation of a <code>INTERVAL YEAR TO MONTH</code>
 *
 * @param string A string representation of the form
 *            <code>[+|-][years]-[months]</code>
 * @return The parsed <code>YEAR TO MONTH</code> object, or
 *         <code>null</code> if the string could not be parsed.
 */
public static YearToMonth valueOf(String string) {
  if (string != null) {
    Matcher matcher = PATTERN.matcher(string);
    if (matcher.find()) {
      boolean negative = "-".equals(matcher.group(1));
      int years = Integer.parseInt(matcher.group(2));
      int months = Integer.parseInt(matcher.group(3));
      return new YearToMonth(years, months, negative);
    }
  }
  return null;
}

代码示例来源:origin: org.jooq/jooq

/**
 * Parse a string representation of a <code>INTERVAL YEAR TO MONTH</code>
 *
 * @param string A string representation of the form
 *            <code>[+|-][years]-[months]</code>
 * @return The parsed <code>YEAR TO MONTH</code> object, or
 *         <code>null</code> if the string could not be parsed.
 */
public static YearToMonth valueOf(String string) {
  if (string != null) {
    Matcher matcher;
    if ((matcher = PATTERN_SQL.matcher(string)).find()) {
      boolean negative = "-".equals(matcher.group(1));
      int years = Integer.parseInt(matcher.group(2));
      int months = Integer.parseInt(matcher.group(3));
      return new YearToMonth(years, months, negative);
    }
    if ((matcher = PATTERN_ISO.matcher(string)).find()) {
      boolean negative = "-".equals(matcher.group(1));
      String group2 = matcher.group(2);
      String group3 = matcher.group(3);
      int years = group2 == null ? 0 : Integer.parseInt(group2);
      int months = group3 == null ? 0 : Integer.parseInt(group3);
      return new YearToMonth(years, months, negative);
    }
  }
  return null;
}

代码示例来源:origin: org.jooq/jooq

/**
 * Convert a Postgres interval to a jOOQ <code>YEAR TO MONTH</code> interval
 */
public static YearToMonth toYearToMonth(Object pgInterval) {
  boolean negative = pgInterval.toString().contains("-");
  Reflect i = on(pgInterval);
  if (negative) {
    i.call("scale", -1);
  }
  YearToMonth result = new YearToMonth(
    i.call("getYears").<Integer>get(),
    i.call("getMonths").<Integer>get());
  if (negative) {
    result = result.neg();
  }
  return result;
}

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

/**
 * Convert a Postgres interval to a jOOQ <code>YEAR TO MONTH</code> interval
 */
public static YearToMonth toYearToMonth(Object pgInterval) {
  boolean negative = pgInterval.toString().contains("-");
  Reflect i = on(pgInterval);
  if (negative) {
    i.call("scale", -1);
  }
  YearToMonth result = new YearToMonth(
    i.call("getYears").<Integer>get(),
    i.call("getMonths").<Integer>get());
  if (negative) {
    result = result.neg();
  }
  return result;
}

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