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