本文整理了Java中org.joda.time.field.UnsupportedDateTimeField
类的一些代码示例,展示了UnsupportedDateTimeField
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnsupportedDateTimeField
类的具体详情如下:
包路径:org.joda.time.field.UnsupportedDateTimeField
类名称:UnsupportedDateTimeField
[英]A placeholder implementation to use when a datetime field is not supported.
UnsupportedDateTimeField is thread-safe and immutable.
[中]不支持日期时间字段时使用的占位符实现。
UnsupportedDataTimeField是线程安全且不可变的。
代码示例来源:origin: joda-time/joda-time
/**
* Ensure proper singleton serialization
*/
private Object readResolve() {
return getInstance(iType, iDurationField);
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
throw unsupported();
}
代码示例来源:origin: joda-time/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public long add(long instant, int value) {
return getDurationField().add(instant, value);
}
代码示例来源:origin: joda-time/joda-time
/**
* Gets an instance of UnsupportedDateTimeField for a specific named field.
* Names should be of standard format, such as 'monthOfYear' or 'hourOfDay'.
* The returned instance is cached.
*
* @param type the type to obtain
* @return the instance
* @throws IllegalArgumentException if durationField is null
*/
public static synchronized UnsupportedDateTimeField getInstance(
DateTimeFieldType type, DurationField durationField) {
UnsupportedDateTimeField field;
if (cCache == null) {
cCache = new HashMap<DateTimeFieldType, UnsupportedDateTimeField>(7);
field = null;
} else {
field = cCache.get(type);
if (field != null && field.getDurationField() != durationField) {
field = null;
}
}
if (field == null) {
field = new UnsupportedDateTimeField(type, durationField);
cCache.put(type, field);
}
return field;
}
代码示例来源:origin: joda-time/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public long add(long instant, long value) {
return getDurationField().add(instant, value);
}
代码示例来源:origin: JodaOrg/joda-time
/**
* Gets an instance of UnsupportedDateTimeField for a specific named field.
* Names should be of standard format, such as 'monthOfYear' or 'hourOfDay'.
* The returned instance is cached.
*
* @param type the type to obtain
* @return the instance
* @throws IllegalArgumentException if durationField is null
*/
public static synchronized UnsupportedDateTimeField getInstance(
DateTimeFieldType type, DurationField durationField) {
UnsupportedDateTimeField field;
if (cCache == null) {
cCache = new HashMap<DateTimeFieldType, UnsupportedDateTimeField>(7);
field = null;
} else {
field = cCache.get(type);
if (field != null && field.getDurationField() != durationField) {
field = null;
}
}
if (field == null) {
field = new UnsupportedDateTimeField(type, durationField);
cCache.put(type, field);
}
return field;
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the hour of day (offset to 1-24) field for this chronology.
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
public DateTimeField clockhourOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.clockhourOfDay(), hours());
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
throw unsupported();
}
代码示例来源:origin: joda-time/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public int getDifference(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifference(minuendInstant, subtrahendInstant);
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the hour of am/pm (offset to 1-12) field for this chronology.
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
public DateTimeField clockhourOfHalfday() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.clockhourOfHalfday(), hours());
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public int getMaximumTextLength(Locale locale) {
throw unsupported();
}
代码示例来源:origin: joda-time/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the year of a week based year field for this chronology.
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
public DateTimeField weekyear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.weekyear(), weekyears());
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) {
throw unsupported();
}
代码示例来源:origin: JodaOrg/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
return getDurationField().getDifferenceAsLong(minuendInstant, subtrahendInstant);
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the month of year field for this chronology.
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
public DateTimeField monthOfYear() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.monthOfYear(), months());
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public String getAsShortText(int fieldValue, Locale locale) {
throw unsupported();
}
代码示例来源:origin: JodaOrg/joda-time
/**
* Delegates to the duration field.
*
* @throws UnsupportedOperationException if the duration is unsupported
*/
public long add(long instant, int value) {
return getDurationField().add(instant, value);
}
代码示例来源:origin: joda-time/joda-time
/**
* Get the millis of day field for this chronology.
*
* @return DateTimeField or UnsupportedDateTimeField if unsupported
*/
public DateTimeField millisOfDay() {
return UnsupportedDateTimeField.getInstance(DateTimeFieldType.millisOfDay(), millis());
}
代码示例来源:origin: joda-time/joda-time
/**
* Always throws UnsupportedOperationException
*
* @throws UnsupportedOperationException
*/
public long set(long instant, int value) {
throw unsupported();
}
内容来源于网络,如有侵权,请联系作者删除!