本文整理汇总了Java中org.joda.time.field.FieldUtils.equals方法的典型用法代码示例。如果您正苦于以下问题:Java FieldUtils.equals方法的具体用法?Java FieldUtils.equals怎么用?Java FieldUtils.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.joda.time.field.FieldUtils
的用法示例。
在下文中一共展示了FieldUtils.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import org.joda.time.field.FieldUtils; //导入方法依赖的package包/类
/**
* Compares this ReadablePartial with another returning true if the chronology,
* field types and values are equal.
*
* @param partial an object to check against
* @return true if fields and values are equal
*/
public boolean equals(Object partial) {
if (this == partial) {
return true;
}
if (partial instanceof ReadablePartial == false) {
return false;
}
ReadablePartial other = (ReadablePartial) partial;
if (size() != other.size()) {
return false;
}
for (int i = 0, isize = size(); i < isize; i++) {
if (getValue(i) != other.getValue(i) || getFieldType(i) != other.getFieldType(i)) {
return false;
}
}
return FieldUtils.equals(getChronology(), other.getChronology());
}
示例2: equals
import org.joda.time.field.FieldUtils; //导入方法依赖的package包/类
/**
* Compares this object with the specified object for equality based
* on start and end millis plus the chronology.
* All ReadableInterval instances are accepted.
* <p>
* To compare the duration of two time intervals, use {@link #toDuration()}
* to get the durations and compare those.
*
* @param readableInterval a readable interval to check against
* @return true if the start and end millis are equal
*/
public boolean equals(Object readableInterval) {
if (this == readableInterval) {
return true;
}
if (readableInterval instanceof ReadableInterval == false) {
return false;
}
ReadableInterval other = (ReadableInterval) readableInterval;
return
getStartMillis() == other.getStartMillis() &&
getEndMillis() == other.getEndMillis() &&
FieldUtils.equals(getChronology(), other.getChronology());
}
示例3: equals
import org.joda.time.field.FieldUtils; //导入方法依赖的package包/类
/**
* A limit chronology is only equal to a limit chronology with the
* same base chronology and limits.
*
* @param obj the object to compare to
* @return true if equal
* @since 1.4
*/
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof LimitChronology == false) {
return false;
}
LimitChronology chrono = (LimitChronology) obj;
return
getBase().equals(chrono.getBase()) &&
FieldUtils.equals(getLowerLimit(), chrono.getLowerLimit()) &&
FieldUtils.equals(getUpperLimit(), chrono.getUpperLimit());
}
示例4: equals
import org.joda.time.field.FieldUtils; //导入方法依赖的package包/类
/**
* Compares this object with the specified object for equality based
* on the millisecond instant, chronology and time zone.
* <p>
* Two objects which represent the same instant in time, but are in
* different time zones (based on time zone id), will be considered to
* be different. Only two objects with the same {@link DateTimeZone},
* {@link Chronology} and instant are equal.
* <p>
* See {@link #isEqual(ReadableInstant)} for an equals method that
* ignores the Chronology and time zone.
* <p>
* All ReadableInstant instances are accepted.
*
* @param readableInstant a readable instant to check against
* @return true if millisecond and chronology are equal, false if
* not or the instant is null or of an incorrect type
*/
public boolean equals(Object readableInstant) {
// must be to fulfil ReadableInstant contract
if (this == readableInstant) {
return true;
}
if (readableInstant instanceof ReadableInstant == false) {
return false;
}
ReadableInstant otherInstant = (ReadableInstant) readableInstant;
return
getMillis() == otherInstant.getMillis() &&
FieldUtils.equals(getChronology(), otherInstant.getChronology());
}