Java 类org.joda.time.field.ScaledDurationField 实例源码

项目:stanford-nlp    文件:JodaTimeUtils.java   
protected static Period getJodaTimePeriod(Partial p)
{
  if (p.size() > 0) {
    DateTimeFieldType dtType = p.getFieldType(p.size()-1);
    DurationFieldType dType = dtType.getDurationType();
    Period period = new Period();
    if (period.isSupported(dType)) {
     return period.withField(dType, 1);
    } else {
      DurationField df = dType.getField(p.getChronology());
      if (df instanceof ScaledDurationField) {
        ScaledDurationField sdf = (ScaledDurationField) df;
        return period.withField(sdf.getWrappedField().getType(), sdf.getScalar());
      }
     // PeriodType.forFields(new DurationFieldType[]{dType});
     // return new Period(df.getUnitMillis(), PeriodType.forFields(new DurationFieldType[]{dType}));

    }
  }
  return null;
}
项目:elasticsearch_my    文件:Joda.java   
@Override
public DurationField getField(Chronology chronology) {
    return new ScaledDurationField(chronology.months(), Quarters, 3);
}
项目:Elasticsearch    文件:Joda.java   
@Override
public DurationField getField(Chronology chronology) {
    return new ScaledDurationField(chronology.months(), Quarters, 3);
}
项目:presto    文件:QuarterOfYearDateTimeField.java   
@Override
public DurationField getField(Chronology chronology)
{
    return new ScaledDurationField(chronology.months(), QUARTER_OF_YEAR_DURATION_FIELD_TYPE, 3);
}
项目:stanford-nlp    文件:JodaTimeUtils.java   
public DurationField getField(Chronology chronology) {
  return new ScaledDurationField(chronology.months(), Quarters, 3);
}
项目:stanford-nlp    文件:JodaTimeUtils.java   
public DurationField getField(Chronology chronology) {
  return new ScaledDurationField(chronology.months(), HalfYears, 6);
}
项目:stanford-nlp    文件:JodaTimeUtils.java   
public DurationField getField(Chronology chronology) {
  return new ScaledDurationField(chronology.years(), Decades, 10);
}
项目:stanford-nlp    文件:JodaTimeUtils.java   
public DurationField getField(Chronology chronology) {
  return new ScaledDurationField(chronology.years(), Centuries, 100);
}
项目:suro    文件:TimestampField.java   
public DurationField getField(Chronology chronology) {
    return new ScaledDurationField(chronology.months(), Quarters, 3);
}