当前位置: 首页>>代码示例>>Java>>正文


Java FieldUtils.equals方法代码示例

本文整理汇总了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());
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:26,代码来源:AbstractPartial.java

示例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());
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:25,代码来源:AbstractInterval.java

示例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());
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:22,代码来源:LimitChronology.java

示例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());
}
 
开发者ID:redfish64,项目名称:TinyTravelTracker,代码行数:32,代码来源:AbstractInstant.java


注:本文中的org.joda.time.field.FieldUtils.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。