/** * Returns order of another interval compared to this one * @param other Interval to compare with * @return -1 if this interval is before the other interval, 1 if this interval is after * 0 otherwise (may indicate the two intervals are same or not comparable) */ public int compareIntervalOrder(Interval<E> other) { int flags = getRelationFlags(other); if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_BEFORE, REL_FLAGS_INTERVAL_UNKNOWN)) { return -1; } else if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_AFTER, REL_FLAGS_INTERVAL_UNKNOWN)) { return 1; } else { return 0; } }
/** * Returns order of another interval compared to this one * @param other Interval to compare with * @return -1 if this interval is before the other interval, 1 if this interval is after * 0 otherwise (may indicate the two intervals are same or not comparable) */ public int compareIntervalOrder(Interval<E> other) { int flags = getRelationFlags(other); if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_BEFORE, REL_FLAGS_INTERVAL_UNKNOWN)) { return -1; } else if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_AFTER, REL_FLAGS_INTERVAL_UNKNOWN)) { return 1; } else { return 0; } }
/** * Returns order of another interval compared to this one * @param other Interval to compare with * @return -1 if this interval is before the other interval, 1 if this interval is after * 0 otherwise (may indicate the two intervals are same or not comparable) */ public int compareIntervalOrder(Interval<E> other) { int flags = getRelationFlags(other); if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_BEFORE, REL_FLAGS_INTERVAL_UNKNOWN)) { return -1; } else if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_AFTER, REL_FLAGS_INTERVAL_UNKNOWN)) { return 1; } else { return 0; } }
/** * Returns order of another interval compared to this one * @param other Interval to compare with * @return -1 if this interval is before the other interval, 1 if this interval is after * 0 otherwise (may indicate the two intervals are same or not comparable) */ public int compareIntervalOrder(Interval<E> other) { int flags = getRelationFlags(other); if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_BEFORE, REL_FLAGS_INTERVAL_UNKNOWN)) { return -1; } else if (checkFlagExclusiveSet(flags, REL_FLAGS_INTERVAL_AFTER, REL_FLAGS_INTERVAL_UNKNOWN)) { return 1; } else { return 0; } }