1 23 24 package info.monitorenter.gui.chart.traces; 25 26 27 import info.monitorenter.gui.chart.TracePoint2D; 28 29 import java.util.Iterator ; 30 31 59 public class Trace2DBijective extends Trace2DSimple { 60 61 64 public Trace2DBijective() { 65 } 66 67 70 public boolean addPointInternal(final TracePoint2D p) { 71 double px = p.getX(); 72 synchronized (this) { 73 Iterator it = this.m_points.iterator(); 74 TracePoint2D tmp = null, removed = null; 75 while (it.hasNext()) { 76 tmp = (TracePoint2D) it.next(); 77 if (tmp.getX() == px) { 78 it.remove(); 79 removed = tmp; 80 break; 81 } 82 } 83 if (removed != null) { 84 this.removePoint(removed); 85 return false; 87 } 88 return super.addPointInternal(p); 89 } 90 } 91 } 92 | Popular Tags |