Check whether this interval overlaps with the other interval
(i.e. the intersect would not be null)
@param other interval to compare with
@return true if this interval overlaps the other interval
496115
public boolean overlaps(Interval<E> other)
  {
    if (other == null) return false;
    int comp12 = this.first.compareTo(other.second());
    int comp21 = this.second.compareTo(other.first());
    if (comp12 > 0 || comp21 < 0) {
      return false;
    } else {
      if (comp12 == 0) {
        if (!this.includesBegin() || !other.includesEnd()) {
          return false;
        }
      }
      if (comp21 == 0) {
        if (!this.includesEnd() || !other.includesBegin()) {
          return false;
        }
      }
      return true;
    }
  }
357811
public boolean isAfterRange(final Range<T> other) {
        if (other == null) {
            return false;
        }
        return other.upperEndpoint.isClosed ? isAfter(other.upperEndpoint.value) : this.lowerEndpoint.compareTo(other.upperEndpoint.value) >= 0;
    }
402222
public final boolean overlaps(HString other) {
      if (other == null) {
         return false;
      }
      return (document() != null && other.document() != null) &&
                (document() == other.document()) &&
                super.overlaps(other);
   }
31251
public boolean isIntervalComparable(Interval<E> other)
  {
    int flags = getRelationFlags(other);
    if (checkMultipleBitSet(flags & REL_FLAGS_INTERVAL_UNKNOWN)) {
      return false;
    }
    return checkFlagSet(flags, REL_FLAGS_INTERVAL_BEFORE) || checkFlagSet(flags, REL_FLAGS_INTERVAL_AFTER);
  }
736400
def overlap(other)
      case self.compare(other)
      when :different_chrom
        0
      when :left_off, :left_adjacent, :left_overlapped
        other.chr_end - self.chr_start + 1
      when :contained_by, :equal
        other.size
      when :contains
        self.size
      when :right_off, :right_adjacent, :right_overlapped
        self.chr_end - other.chr_start + 1
      else
        raise Exception, "must not happen"
      end
    end
540648
public boolean contains(Envelope2D other) {// Note: Will return False, if
												// either envelope is empty.
		return other.xmin >= xmin && other.xmax <= xmax && other.ymin >= ymin
				&& other.ymax <= ymax;
	}
125376
public static boolean isTimeConflict(Time timeFrom, Time timeTo, Time otherTimeFrom, Time otherTimeTo) {
		if (JKDateTimeUtil.isTimesEqaualed(timeFrom, otherTimeFrom) || JKDateTimeUtil.isTimesEqaualed(timeTo, otherTimeTo)) {
			return true;
		}

		// other time start time is between start and end time for this time
		if (timeFrom.after(otherTimeFrom) && timeFrom.before(otherTimeTo)) {
			return true;
		}

		// other time e is between start and end time for this time
		if (timeTo.after(otherTimeFrom) && timeTo.before(otherTimeTo)) {
			return true;
		}

		// if time starting before this time and ends after this time
		if (timeFrom.before(otherTimeFrom) && timeTo.after(otherTimeTo)) {
			return true;
		}

		return false;
	}
755605
public boolean isBeforeRange(final Range<T> other) {
        if (other == null) {
            return false;
        }

        return other.lowerEndpoint.isClosed ? isBefore(other.lowerEndpoint.value) : this.upperEndpoint.compareTo(other.lowerEndpoint.value) <= 0;
    }
401646
private static boolean checkCollide(Area area, Collidable other)
    {
        final List<Rectangle> others = other.getCollisionBounds();
        final int size = others.size();
        for (int i = 0; i < size; i++)
        {
            final Area current = others.get(i);
            if (area.intersects(current))
            {
                return true;
            }
        }
        return false;
    }
482079
public static boolean overlap(@Nullable String[] as, @Nullable String[] bs)
  {
    if (as == null || bs == null) {
      // They only have overlap if both are null.
      return as == null && bs == null;
    }
    if (as.length == 0 && bs.length == 0) {
      return true;
    }

    for (String a : as) {
      for (String b : bs) {
        if (Objects.equals(a, b)) {
          return true;
        }
      }
    }

    return false;
  }
1328981
def is_bbox_not_intersecting(self, other):
        """"""

        self_x_min, self_x_max, self_y_min, self_y_max = self.get_bbox()
        other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()

        return \
            self_x_min > other_x_max or \
            other_x_min > self_x_max or \
            self_y_min > other_y_max or \
            other_y_min > self_y_max
123021
def within(self, other: "Interval", inclusive: bool = True) -> bool:
        
        if not other:
            return False
        if inclusive:
            return self.start >= other.start and self.end <= other.end
        else:
            return self.start > other.start and self.end < other.end
144844
def do_intersect(self, another_time_range):
        
        if self.begin_dt > another_time_range.end_dt or self.end_dt < \
                another_time_range.begin_dt:
            return False
        else:
            return True
867340
@SuppressWarnings("unchecked")
    public T overlap(final T otherInterval) {
        if (otherInterval == null) {
            return null;
        }
        if (otherInterval.isInfinite()) {
            return (T)this;
        }
        if (this.isInfinite()) {
            return otherInterval;
        }
        final Interval thisAsInterval = asInterval();
        final Interval otherAsInterval = otherInterval.asInterval();
        Interval overlap = thisAsInterval.overlap(otherAsInterval);
        if (overlap == null) {
            return null;
        }
        return newInterval(overlap);
    }
149919
public boolean conflictsWith(OptionalBoolean other) {
		return state == State.CONFLICTING
			|| other.state == State.CONFLICTING
			|| (state == State.TRUE && other.state == State.FALSE)
			|| (state == State.FALSE && other.state == State.TRUE);
	}
845637
public void intersectWith(LockSet other) {
        for (int i = 0; i + 1 < array.length; i += 2) {
            int valueNumber = array[i];
            if (valueNumber < 0) {
                break;
            }
            int myLockCount = array[i + 1];
            if (myLockCount <= 0) {
                continue;
            }
            int otherLockCount = other.getLockCount(valueNumber);
            if (otherLockCount <= 0) {
                /* This set holds the lock, but the other one doesn't. */
                array[i + 1] = 0;
            }
        }
    }
1338590
public boolean contains(Bbox other) {
		if (other.getX() < this.getX()) {
			return false;
		}
		if (other.getY() < this.getY()) {
			return false;
		}
		if (other.getEndPoint().getX() > this.getEndPoint().getX()) {
			return false;
		}
		if (other.getEndPoint().getY() > this.getEndPoint().getY()) {
			return false;
		}
		return true;
	}