本文整理汇总了Java中org.joda.time.DateTimeField.getType方法的典型用法代码示例。如果您正苦于以下问题:Java DateTimeField.getType方法的具体用法?Java DateTimeField.getType怎么用?Java DateTimeField.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joda.time.DateTimeField
的用法示例。
在下文中一共展示了DateTimeField.getType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ZonedDateTimeField
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
ZonedDateTimeField(DateTimeField field,
DateTimeZone zone,
DurationField durationField,
DurationField rangeDurationField,
DurationField leapDurationField) {
super(field.getType());
if (!field.isSupported()) {
throw new IllegalArgumentException();
}
iField = field;
iZone = zone;
iDurationField = durationField;
iTimeField = useTimeArithmetic(durationField);
iRangeDurationField = rangeDurationField;
iLeapDurationField = leapDurationField;
}
示例2: CutoverField
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
/**
* @param julianField field from the chronology used before the cutover instant
* @param gregorianField field from the chronology used at and after the cutover
* @param cutoverMillis the millis of the cutover
* @param convertByWeekyear
*/
CutoverField(DateTimeField julianField, DateTimeField gregorianField,
long cutoverMillis, boolean convertByWeekyear) {
super(gregorianField.getType());
iJulianField = julianField;
iGregorianField = gregorianField;
iCutover = cutoverMillis;
iConvertByWeekyear = convertByWeekyear;
// Although average length of Julian and Gregorian years differ,
// use the Gregorian duration field because it is more accurate.
iDurationField = gregorianField.getDurationField();
DurationField rangeField = gregorianField.getRangeDurationField();
if (rangeField == null) {
rangeField = julianField.getRangeDurationField();
}
iRangeDurationField = rangeField;
}
示例3: DelegatedDateTimeField
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param field the field being decorated
* @param type the field type override
*/
public DelegatedDateTimeField(DateTimeField field, DateTimeFieldType type) {
super();
if (field == null) {
throw new IllegalArgumentException("The field must not be null");
}
iField = field;
iType = (type == null ? field.getType() : type);
}
示例4: verifyValueBounds
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
/**
* Verify that input values are within specified bounds.
*
* @param value the value to check
* @param lowerBound the lower bound allowed for value
* @param upperBound the upper bound allowed for value
* @throws IllegalFieldValueException if value is not in the specified bounds
*/
public static void verifyValueBounds(DateTimeField field,
int value, int lowerBound, int upperBound) {
if ((value < lowerBound) || (value > upperBound)) {
throw new IllegalFieldValueException
(field.getType(), Integer.valueOf(value),
Integer.valueOf(lowerBound), Integer.valueOf(upperBound));
}
}
示例5: LimitDateTimeField
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
LimitDateTimeField(DateTimeField field,
DurationField durationField,
DurationField rangeDurationField,
DurationField leapDurationField) {
super(field, field.getType());
iDurationField = durationField;
iRangeDurationField = rangeDurationField;
iLeapDurationField = leapDurationField;
}
示例6: OffsetDateTimeField
import org.joda.time.DateTimeField; //导入方法依赖的package包/类
/**
* Constructor.
*
* @param field the field to wrap, like "year()".
* @param offset offset to add to field values
* @throws IllegalArgumentException if offset is zero
*/
public OffsetDateTimeField(DateTimeField field, int offset) {
this(field, (field == null ? null : field.getType()), offset, Integer.MIN_VALUE, Integer.MAX_VALUE);
}