本文整理匯總了Java中org.joda.time.DateTimeFieldType.monthOfYear方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTimeFieldType.monthOfYear方法的具體用法?Java DateTimeFieldType.monthOfYear怎麽用?Java DateTimeFieldType.monthOfYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.joda.time.DateTimeFieldType
的用法示例。
在下文中一共展示了DateTimeFieldType.monthOfYear方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMaximumValue
import org.joda.time.DateTimeFieldType; //導入方法依賴的package包/類
@Override
public int getMaximumValue(ReadablePartial partial, int[] values) {
int size = partial.size();
for (int i = 0; i < size; i++) {
if (partial.getFieldType(i) == DateTimeFieldType.monthOfYear()) {
int month = values[i];
return this.daysInMonth[month - 1];
}
}
return this.getMaximumValue();
}
示例2: monthOfYearTextToValue
import org.joda.time.DateTimeFieldType; //導入方法依賴的package包/類
public int monthOfYearTextToValue(String text) {
Integer month = iParseMonths.get(text);
if (month != null) {
return month.intValue();
}
throw new IllegalFieldValueException(DateTimeFieldType.monthOfYear(), text);
}
示例3: BasicMonthOfYearDateTimeField
import org.joda.time.DateTimeFieldType; //導入方法依賴的package包/類
/**
* Restricted constructor.
*
* @param leapMonth the month of year that leaps
*/
BasicMonthOfYearDateTimeField(BasicChronology chronology, int leapMonth) {
super(DateTimeFieldType.monthOfYear(), chronology.getAverageMillisPerMonth());
iChronology = chronology;
iMax = iChronology.getMaxMonth();
iLeapMonth = leapMonth;
}
示例4: MonthOfFixedYearDateTimeField
import org.joda.time.DateTimeFieldType; //導入方法依賴的package包/類
public MonthOfFixedYearDateTimeField(FixedYearVariableMonthChronology chron) {
super(DateTimeFieldType.monthOfYear(), chron.getAverageMillisInMonth());
this.chron = chron;
this.daysInMonth = chron.getMonthLengths();
this.numMonthsInYear = chron.getMonthLengths().length;
}