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

项目:LAS    文件:FixedYearLengthChronology.java   
/**
 * @param daysInYear The number of days in each year
 */
protected FixedYearLengthChronology(int daysInYear) {
    this.daysInYear = daysInYear;

    this.yearDuration = new PreciseDurationField(DurationFieldType.years(),
            daysInYear * dayDuration.getUnitMillis());
    this.centuryDuration = new PreciseDurationField(DurationFieldType.centuries(),
            100 * yearDuration.getUnitMillis());

    this.dayOfYear = new OneBasedPreciseDateTimeField(DateTimeFieldType.dayOfYear(),
            dayDuration, this.yearDuration);
    this.yearOfCentury =  new PreciseDateTimeField(DateTimeFieldType.yearOfCentury(),
            this.yearDuration, this.centuryDuration);
    this.year = new YearField(this.yearDuration);
}
项目:edal-java    文件:FixedYearLengthChronology.java   
/**
 * @param daysInYear
 *            The number of days in each year
 */
protected FixedYearLengthChronology(int daysInYear) {
    this.daysInYear = daysInYear;

    this.yearDuration = new PreciseDurationField(DurationFieldType.years(), daysInYear
            * dayDuration.getUnitMillis());
    this.centuryDuration = new PreciseDurationField(DurationFieldType.centuries(),
            100 * yearDuration.getUnitMillis());

    this.dayOfYear = new OneBasedPreciseDateTimeField(DateTimeFieldType.dayOfYear(),
            dayDuration, this.yearDuration);
    this.yearOfCentury = new PreciseDateTimeField(DateTimeFieldType.yearOfCentury(),
            this.yearDuration, this.centuryDuration);
    this.year = new YearField(this.yearDuration);
}