gpt4 book ai didi

de.undercouch.citeproc.zotero.ZoteroItemDataProvider.getYear()方法的使用及代码示例

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

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

ZoteroItemDataProvider.getYear介绍

[英]Retrieves the year from a CSLDate object. Parses the raw string if necessary.
[中]从CSLDate对象检索年份。如有必要,解析原始字符串。

代码示例

代码示例来源:origin: michel-kraemer/citeproc-java

int year = getYear(item.getIssued(), dateParser);
if (year < 0) {
  year = getYear(item.getContainer(), dateParser);
  if (year < 0) {
    year = getYear(item.getOriginalDate(), dateParser);
    if (year < 0) {
      year = getYear(item.getEventDate(), dateParser);
      if (year < 0) {
        year = getYear(item.getSubmitted(), dateParser);

代码示例来源:origin: de.undercouch/citeproc-java

int year = getYear(item.getIssued(), dateParser);
if (year < 0) {
  year = getYear(item.getContainer(), dateParser);
  if (year < 0) {
    year = getYear(item.getOriginalDate(), dateParser);
    if (year < 0) {
      year = getYear(item.getEventDate(), dateParser);
      if (year < 0) {
        year = getYear(item.getSubmitted(), dateParser);

代码示例来源:origin: de.undercouch/citeproc-java

/**
   * Retrieves the year from a {@link CSLDate} object. Parses the raw
   * string if necessary.
   * @param date the date object
   * @param dateParser a date parser
   * @return the year or -1 if the year could not be retrieved
   */
  private static int getYear(CSLDate date, CSLDateParser dateParser) {
    if (date == null) {
      return -1;
    }
    if (date.getDateParts() == null ||
        date.getDateParts().length == 0 ||
        date.getDateParts()[0] == null ||
        date.getDateParts()[0].length == 0) {
      if (date.getRaw() != null && !date.getRaw().isEmpty()) {
        CSLDate d = dateParser.parse(date.getRaw());
        return getYear(d, dateParser);
      }
      return -1;
    }
    return date.getDateParts()[0][0];
  }
}

代码示例来源:origin: michel-kraemer/citeproc-java

/**
   * Retrieves the year from a {@link CSLDate} object. Parses the raw
   * string if necessary.
   * @param date the date object
   * @param dateParser a date parser
   * @return the year or -1 if the year could not be retrieved
   */
  private static int getYear(CSLDate date, CSLDateParser dateParser) {
    if (date == null) {
      return -1;
    }
    if (date.getDateParts() == null ||
        date.getDateParts().length == 0 ||
        date.getDateParts()[0] == null ||
        date.getDateParts()[0].length == 0) {
      if (date.getRaw() != null && !date.getRaw().isEmpty()) {
        CSLDate d = dateParser.parse(date.getRaw());
        return getYear(d, dateParser);
      }
      return -1;
    }
    return date.getDateParts()[0][0];
  }
}

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