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

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

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

UnsupportedDurationField介绍

[英]A placeholder implementation to use when a duration field is not supported.

UnsupportedDurationField is thread-safe and immutable.
[中]不支持持续时间字段时使用的占位符实现。
UnsupportedDurationField是线程安全且不可变的。

代码示例

代码示例来源:origin: joda-time/joda-time

/**
 * Gets an instance of UnsupportedDurationField for a specific named field.
 * The returned instance is cached.
 * 
 * @param type  the type to obtain
 * @return the instance
 */
public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
  UnsupportedDurationField field;
  if (cCache == null) {
    cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
    field = null;
  } else {
    field = cCache.get(type);
  }
  if (field == null) {
    field = new UnsupportedDurationField(type);
    cCache.put(type, field);
  }
  return field;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Ensure proper singleton serialization
 */
private Object readResolve() {
  return getInstance(iType);
}

代码示例来源:origin: joda-time/joda-time

/**
 * Get a suitable debug string.
 * 
 * @return debug string
 */
public String toString() {
  return "UnsupportedDurationField[" + getName() + ']';
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public long getMillis(int value) {
  throw unsupported();
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public int getDifference(long minuendInstant, long subtrahendInstant) {
  throw unsupported();
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
  throw unsupported();
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Ensure proper singleton serialization
 */
private Object readResolve() {
  return getInstance(iType);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Get a suitable debug string.
 * 
 * @return debug string
 */
public String toString() {
  return "UnsupportedDurationField[" + getName() + ']';
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Gets an instance of UnsupportedDurationField for a specific named field.
 * The returned instance is cached.
 * 
 * @param type  the type to obtain
 * @return the instance
 */
public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
  UnsupportedDurationField field;
  if (cCache == null) {
    cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
    field = null;
  } else {
    field = cCache.get(type);
  }
  if (field == null) {
    field = new UnsupportedDurationField(type);
    cCache.put(type, field);
  }
  return field;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public long getValueAsLong(long duration, long instant) {
  throw unsupported();
}

代码示例来源:origin: joda-time/joda-time

/**
 * Get the seconds duration field for this chronology.
 * 
 * @return DurationField or UnsupportedDurationField if unsupported
 */
public DurationField seconds() {
  return UnsupportedDurationField.getInstance(DurationFieldType.seconds());
}

代码示例来源:origin: joda-time/joda-time

/**
 * Gets a suitable hashcode.
 * 
 * @return the hashcode
 */
public int hashCode() {
  return getName().hashCode();
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Gets an instance of UnsupportedDurationField for a specific named field.
 * The returned instance is cached.
 * 
 * @param type  the type to obtain
 * @return the instance
 */
public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
  UnsupportedDurationField field;
  if (cCache == null) {
    cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
    field = null;
  } else {
    field = cCache.get(type);
  }
  if (field == null) {
    field = new UnsupportedDurationField(type);
    cCache.put(type, field);
  }
  return field;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public long add(long instant, long value) {
  throw unsupported();
}

代码示例来源:origin: joda-time/joda-time

/**
 * Get the minutes duration field for this chronology.
 * 
 * @return DurationField or UnsupportedDurationField if unsupported
 */
public DurationField minutes() {
  return UnsupportedDurationField.getInstance(DurationFieldType.minutes());
}

代码示例来源:origin: joda-time/joda-time

/**
 * Compares this duration field to another.
 * 
 * @param obj  the object to compare to
 * @return true if equal
 */
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  } else if (obj instanceof UnsupportedDurationField) {
    UnsupportedDurationField other = (UnsupportedDurationField) obj;
    if (other.getName() == null) {
      return (getName() == null);
    }
    return (other.getName().equals(getName()));
  }
  return false;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public long getValueAsLong(long duration) {
  throw unsupported();
}

代码示例来源:origin: joda-time/joda-time

/**
 * Get the weeks duration field for this chronology.
 * 
 * @return DurationField or UnsupportedDurationField if unsupported
 */
public DurationField weeks() {
  return UnsupportedDurationField.getInstance(DurationFieldType.weeks());
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Compares this duration field to another.
 * 
 * @param obj  the object to compare to
 * @return true if equal
 */
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  } else if (obj instanceof UnsupportedDurationField) {
    UnsupportedDurationField other = (UnsupportedDurationField) obj;
    if (other.getName() == null) {
      return (getName() == null);
    }
    return (other.getName().equals(getName()));
  }
  return false;
}

代码示例来源:origin: joda-time/joda-time

/**
 * Always throws UnsupportedOperationException
 *
 * @throws UnsupportedOperationException
 */
public int getValue(long duration) {
  throw unsupported();
}

相关文章