main/plugins/org.talend.libraries.jfreechart.jars/lib_src/jfreechart-1.0.12/source/org/jfree/data/time/SimpleTimePeriod.java
/**
     * Returns an integer that indicates the relative ordering of two
     * time periods.
     *
     * @param obj  the object (<code>null</code> not permitted).
     *
     * @return An integer.
     *
     * @throws ClassCastException if <code>obj</code> is not an instance of
     *                            {@link TimePeriod}.
     */
Returns an integer that indicates the relative ordering of two
time periods.

@param obj  the object (null not permitted).

@return An integer.

@throws ClassCastException if obj is not an instance of
TimePeriod.
Returns an integer that indicates the relative ordering of two time periods . @param obj the object ( null not permitted ) . @return An integer . @throws ClassCastException if obj is not an instance of TimePeriod .
public int compareTo(Object obj) {
        TimePeriod that = (TimePeriod) obj;
        long t0 = getStart().getTime();
        long t1 = getEnd().getTime();
        long m0 = t0 + (t1 - t0) / 2L;
        long t2 = that.getStart().getTime();
        long t3 = that.getEnd().getTime();
        long m1 = t2 + (t3 - t2) / 2L;
        if (m0 < m1) {
            return -1;
        }
        else if (m0 > m1) {
            return 1;
        }
        else {
            if (t0 < t2) {
                return -1;
            }
            else if (t0 > t2) {
                return 1;
            }
            else {
                if (t1 < t3) {
                    return -1;
                }
                else if (t1 > t3) {
                    return 1;
                }
                else {
                    return 0;
                }
            }
        }
    }
public int compareTo ( Object obj ) { TimePeriod that = ( TimePeriod ) obj ; long t0 = getStart ( ) . getTime ( ) ; long t1 = getEnd ( ) . getTime ( ) ; long m0 = t0 + ( t1 - t0 ) / 2L ; long t2 = that . getStart ( ) . getTime ( ) ; long t3 = that . getEnd ( ) . getTime ( ) ; long m1 = t2 + ( t3 - t2 ) / 2L ; if ( m0 < m1 ) { return - 1 ; } else if ( m0 > m1 ) { return 1 ; } else { if ( t0 < t2 ) { return - 1 ; } else if ( t0 > t2 ) { return 1 ; } else { if ( t1 < t3 ) { return - 1 ; } else if ( t1 > t3 ) { return 1 ; } else { return 0 ; } } } }
Returns an integer that indicates the relative ordering of two
 time periods.
Returns an integer that indicates the relative ordering of two time periods .