import edu.gwu.algtest.*; import edu.gwu.util.*; import edu.gwu.debug.*; import edu.gwu.geometry.*; import java.util.*; public class HashIntersection implements LineSegmentIntersectionAlgorithm { int algID; PropertyExtractor prop; int numIntervals; public String getName () { return "HashInsersection"; } public void setPropertyExtractor (int algID, PropertyExtractor prop) { try { this.algID = algID; this.prop = prop; numIntervals = prop.getIntProperty ("alg" + algID + ".numIntervals"); } catch (UtilException e) { e.printStackTrace(); System.exit(1); } } public Pointd[] findIntersections (LineSegment[] segments) { // 1. Build the hash table. // 2. Insert segments. // 3. Scan segments and check for intersections, storing intersection points. // 4. Put intersection points so found in an array and return it. } }