org.joda.time.field.UnsupportedDateTimeField类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.joda.time.field.UnsupportedDateTimeField类的一些代码示例,展示了UnsupportedDateTimeField类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UnsupportedDateTimeField类的具体详情如下:
包路径:org.joda.time.field.UnsupportedDateTimeField
类名称: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();
}

相关文章