/** * Print the current state of this SpatialCluster to the given File. * * <p>Used mainly for debugging. * * @param file the File to write the current state to. * @throws IOException if an I/O occurred when trying to write to <code>file</code> */ void exportCurrState(File file) throws IOException { file.createNewFile(); PrintStream out = new PrintStream(file); Iterator<MatchPoint> it = currPoints.iterator(); while (it.hasNext()) { MatchPoint tmp = it.next(); out.println(tmp.x() + "\t" + Math.abs(tmp.y()) + "\t0"); } Iterator<ReadCluster> kcIt = readPairClusters.iterator(); while (kcIt.hasNext()) { ReadCluster tmpKc = kcIt.next(); it = tmpKc.getMatchPoints().iterator(); while (it.hasNext()) { MatchPoint tmp = it.next(); out.println(tmp.x() + "\t" + Math.abs(tmp.y()) + "\t" + tmpKc.id); } } out.close(); }
@Override public int compare(MatchPoint arg0, MatchPoint arg1) { if (arg0.x() == arg1.x()) return arg0.y() - arg1.y(); else return arg0.x() - arg1.x(); }