/** * Checks if this region contains the given location. * * @param x X ordinate * @param y Y ordinate * @return {@code true} if the region contains the location; * {@code false} otherwise */ public boolean contains(int x, int y) { if (!bounds.contains(x, y)) { return false; } List<Integer> indices = index.get(y); for (Integer i : indices) { FloodFiller.ScanSegment segment = segments.get(i); if (segment.contains(x, y)) { return true; } } return false; }
segment = new ScanSegment(left, right, y); segmentsFilled.add(segment); segmentsPending.offer(segment);