1 22 23 package info.monitorenter.gui.chart.traces; 24 25 import info.monitorenter.gui.chart.ITrace2D; 26 import info.monitorenter.gui.chart.TracePoint2D; 27 28 import java.util.Iterator ; 29 import java.util.LinkedList ; 30 31 55 public class Trace2DSimple extends ATrace2D implements ITrace2D { 56 57 58 protected LinkedList m_points = new LinkedList (); 59 60 64 public Trace2DSimple() { 65 this(Trace2DSimple.class.getName() + "-" + ATrace2D.getInstanceCount()); 66 } 67 68 75 public Trace2DSimple(final String name) { 76 this.setName(name); 77 } 78 79 82 protected boolean addPointInternal(final TracePoint2D p) { 83 this.m_points.add(p); 84 return true; 85 } 86 87 90 public final int getMaxSize() { 91 return Integer.MAX_VALUE; 92 } 93 94 97 public final int getSize() { 98 return this.m_points.size(); 99 } 100 101 104 public boolean isEmpty() { 105 return this.m_points.size() == 0; 106 } 107 108 111 public Iterator iterator() { 112 return this.m_points.iterator(); 113 } 114 115 118 public final void removeAllPointsInternal() { 119 this.m_points.clear(); 120 } 121 122 125 protected boolean removePointInternal(final TracePoint2D point) { 126 return this.m_points.remove(point); 127 } 128 129 } 130 | Popular Tags |