gpt4 book ai didi

pl.edu.icm.model.bwmeta.y.YDate.getYear()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 22:54:40 27 4
gpt4 key购买 nike

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

YDate.getYear介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected Integer getYear(List<YDate> dates) {
  for (YDate date : dates) {
    return date.getYear();
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

private String parseDate(YDate yDate) {
  if (yDate.getYear() > 0 && yDate.getMonth() > 0 && yDate.getDay() > 0) {
    return yDate.getYear() + "/" + yDate.getMonth() + "/" + yDate.getDay();
  }
  if (yDate.getYear() > 0) {
    return String.valueOf(yDate.getYear());
  }
  return null;
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

/**
 * Selects most appropriate (Publication's if available) data.
 */
protected static String selectBestDate(List<YDate> dates) {
  if (dates == null || dates.size() == 0) {
    return null;
  }
        int py = dates.get(0).getYear();
  for (YDate date: dates) { //Search for English version
    if (date.getType().equals(YConstants.DT_PUBLISHED)) {
      py = date.getYear();
    }
  }
  
  if (py > 1000) {
    return new Integer(py).toString();
  } else {
    return null;    
  } 
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * accomplished
 */
private void parseDates() {
  if(!in_item.getDates().isEmpty()){
    for(YDate yd : in_item.getDates()){
      if(yd.getYear()!=0)
        paos_doc.add(new PredicateAndObject(RelConstants.RL_YEAR, ""+yd.getYear()));
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * accomplished
 */
private void parseDates() {
  if(!in_item.getDates().isEmpty()){
    for(YDate yd : in_item.getDates()){
      if(yd.getYear()!=0)
        paos_doc.add(new PredicateAndObject(RelConstants.RL_YEAR, ""+yd.getYear()));
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import

/**
 * Selects most apropriate (English if available) description.
 * 
 * @param descriptions
 *            list of available descriptions
 * @return best found description or null if list is empty
 */
protected static String selectBestDate(List<YDate> dates) {
  if (dates == null || dates.size() == 0) {
    return null;
  }
  StringBuilder text = new StringBuilder();
    
  for (YDate date : dates) {
    text.append(date.getType() + ":"+date.getYear()+YElementToZentralBlattConverter.SUGGESTED_MULTIVALUE_FIELD_SEPARATOR);
  }
  return text.toString();
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

protected void convertDate(YElement yElement, BibEntry bibEntry) {
  YDate date = yElement.getDate(YConstants.DT_PUBLISHED);
  if (date != null) {
    if (bibEntry.getFirstFieldValue(BibEntry.FIELD_YEAR) == null) {
      bibEntry.setField(BibEntry.FIELD_YEAR, String.valueOf(date.getYear()));
    }
    bibEntry.setField(BibEntry.FIELD_MONTH, String.valueOf(date.getMonth()));
    date.getYear();
  }
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

protected void fillDates(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
  //        date element
  if (!yElement.getDates().isEmpty()) {
    ret.put(E_DATE, new ArrayList<StringWithAttributes>());
  }
  for (YDate yDate : yElement.getDates()) {
    String yDateStr;
    String y = String.format("%02d", yDate.getYear());
    String m = String.format("%02d", yDate.getMonth());
    String d = String.format("%02d", yDate.getDay());
    if (y != null && m != null && d != null) {
      yDateStr = y + "-" + m + "-" + d;
    } else if (y != null && m != null) {
      yDateStr = y + "-" + m;
    } else if (y != null) {
      yDateStr = y;
    } else {
      yDateStr = yDate.getText();
    }
    StringWithAttributes dat = new StringWithAttributes(yDateStr);
    dat.addAttribute("dateType", yDate.getType());
    ret.get(E_DATE).add(dat);
    // root.addContent(date);
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-core-services-impl

@Override
public BasicDBObject convert(YDate source) {
  if(source == null){
    return null;
  }
  BasicDBObject object = new BasicDBObject();
  object.put("year", source.getYear());
  object.put("day", source.getDay());
  object.put("month", source.getMonth());
  object.put("type", source.getType());
  object.put("text", source.getText());
  DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
  String dateString = String.format("%04d%02d%02d", getOneIfZero(source.getYear()), getOneIfZero(source.getMonth()), getOneIfZero(source.getDay()));
  try {
    Date parsedDate = dateFormat.parse(dateString);
    object.put("date", parsedDate);
  } catch (ParseException e) {
    LOGGER.warn("Couldn't parse date: " + dateString);
  }
  return object;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private void addDateFromYElem(YDate publishedDate, CSLDateBuilder dateBuilder) {
  int year = publishedDate.getYear();
  int month = publishedDate.getMonth();
  int day = publishedDate.getDay();
  boolean hasYear = year != 0;
  boolean hasMonth = month != 0;
  boolean hasDay = day != 0;
  if (hasYear && hasMonth && hasDay) {
    dateBuilder.dateParts(year, month, day);
  } else if (hasYear && hasMonth) {
    dateBuilder.dateParts(year, month);
  } else if(hasYear) {
    dateBuilder.dateParts(year);
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private void addPublicationDate(CSLItemDataBuilder builder, ElementAncestors<YElement> elemAncest) {
  YDate publishedDate = elemAncest.getElement().getDate(YConstants.DT_PUBLISHED);
  CSLDateBuilder dateBuilder = new CSLDateBuilder();
  if (publishedDate != null && (publishedDate.getYear() != 0)) {
    addDateFromYElem(publishedDate, dateBuilder);
  } else {
    addDateFromJournalYearAncest(elemAncest, dateBuilder);
  }
  builder.issued(dateBuilder.build());
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

public DateTime parseDate(final YDate yDate) throws InvalidDateException {
  DateTime parsedDate;
  try {
    parsedDate = new DateTime(yDate.getYear(), yDate.getMonth() > 0 ? yDate.getMonth() : 1, yDate.getDay() > 0 ? yDate.getDay() : 1, 0, 0,
        DateTimeZone.UTC);
  } catch (IllegalFieldValueException e) {
    throw new InvalidDateException("Incorrect values in YDates.", e);
  }
  if (yDate.getDay() == 0) {
    parsedDate = parsedDate.dayOfMonth().withMinimumValue();
  }
  if (yDate.getMonth() == 0) {
    parsedDate = parsedDate.dayOfYear().withMinimumValue();
  }
  return parsedDate;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

continue;
if (elementDate.getYear() == 0) {
  continue;
metadata.setYear(Integer.toString(elementDate.getYear()));
if (elementDate.getMonth() != 0) {
  metadata.setMonth(Integer.toString(elementDate.getMonth()));

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

if(yd.getYear()!=0)
  paos_doc.add(new PredicateAndObject(RelConstants.RL_YEAR, ""+yd.getYear()));

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

docMetadata.setYear(Integer.toString(yElement.getDate(YConstants.DT_PUBLISHED).getYear()));

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

docMetadata.setYear(Integer.toString(yElement.getDate(YConstants.DT_PUBLISHED).getYear()));

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