Java Geometry Algorithm cleanList(List blueList, Polygon borders)

Here you can find the source of cleanList(List blueList, Polygon borders)

Description

clean List

License

Open Source License

Declaration

private static int cleanList(List<Point> blueList, Polygon borders) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Point;
import java.awt.Polygon;

import java.util.List;

public class Main {
    private static int cleanList(List<Point> blueList, Polygon borders) {
        int numRemoved = 0;
        for (int i = 0; i < blueList.size(); i++) {
            Point currentPoint = blueList.get(i);
            if (borders.contains(currentPoint)) {
                blueList.remove(i);/*from   w  ww  . j  a  va  2s .c  om*/
                i--;
                numRemoved++;
            }
        }
        return numRemoved;
    }
}

Related

  1. checkPoint(Point p)
  2. checkPoint(Point point, String name)
  3. checkWinPossibility(int[][] board, Point p1, Point p2, int playerID)
  4. circleLineIntersection(double theta, double r, double h, double k, Point2D[] result)
  5. clacGradient(Point2D p1, Point2D p2, Point2D p3)
  6. colinearPoint(Line2D line, Point2D point, double distance)
  7. computeAngleDEG(@Nonnull Point2D p1, @Nonnull Point2D p2)
  8. computeAngleRAD(@Nonnull Point2D p)
  9. computeBarycenter(Map values)