下面列出了org.joda.time.PeriodType#isSupported ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}
boolean isSupported(PeriodType type, int field) {
switch (field) {
default:
return false;
case YEARS:
return type.isSupported(DurationFieldType.years());
case MONTHS:
return type.isSupported(DurationFieldType.months());
case WEEKS:
return type.isSupported(DurationFieldType.weeks());
case DAYS:
return type.isSupported(DurationFieldType.days());
case HOURS:
return type.isSupported(DurationFieldType.hours());
case MINUTES:
return type.isSupported(DurationFieldType.minutes());
case SECONDS:
return type.isSupported(DurationFieldType.seconds());
case MILLIS:
return type.isSupported(DurationFieldType.millis());
case SECONDS_MILLIS: // drop through
case SECONDS_OPTIONAL_MILLIS:
return type.isSupported(DurationFieldType.seconds()) ||
type.isSupported(DurationFieldType.millis());
}
}