本文整理汇总了Java中org.joda.time.PeriodType.days方法的典型用法代码示例。如果您正苦于以下问题:Java PeriodType.days方法的具体用法?Java PeriodType.days怎么用?Java PeriodType.days使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joda.time.PeriodType
的用法示例。
在下文中一共展示了PeriodType.days方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPeriodType
import org.joda.time.PeriodType; //导入方法依赖的package包/类
private static PeriodType getPeriodType(OrgInterval.Unit unit) {
switch (unit) {
case HOUR:
return PeriodType.hours();
case DAY:
return PeriodType.days();
case WEEK:
return PeriodType.weeks();
case MONTH:
return PeriodType.months();
case YEAR:
return PeriodType.years();
default:
throw new IllegalArgumentException("Unknown unit " + unit);
}
}
示例2: dayDiff
import org.joda.time.PeriodType; //导入方法依赖的package包/类
public int dayDiff(final LocalDate start, final LocalDate end, final PeriodCountBasis basis) {
int diff;
switch (basis) {
case CONV_30_360:
diff = diffConv30v360(start, end);
break;
case CONV_360E_ISDA:
diff = diff360EIsda(start, end);
break;
case CONV_360E_ISMA:
diff = diff360EIsma(start, end);
break;
default:
final Period p = new Period(start, end, PeriodType.days());
diff = p.getDays();
}
return diff;
}
示例3: getItemCount
import org.joda.time.PeriodType; //导入方法依赖的package包/类
@Override
public int getItemCount() {
if (currentDate == null || startDate == null || endDate == null) {
return 0;
} else {
Period period = new Period(startDate, endDate, PeriodType.days());
return period.getDays() + 7;
}
}
示例4: getPositionFromDate
import org.joda.time.PeriodType; //导入方法依赖的package包/类
public int getPositionFromDate(LocalDate date) {
if (date == null || date.isBefore(startDate) || date.isAfter(endDate)) {
return 0;
} else {
Period period = new Period(startDate, date, PeriodType.days());
return period.getDays();
}
}
示例5: getCount
import org.joda.time.PeriodType; //导入方法依赖的package包/类
@Override
public int getCount() {
Period period = new Period(startDate, endDate, PeriodType.days());
return period.getDays();
}