1 23 24 package info.monitorenter.gui.chart.traces; 25 26 import info.monitorenter.gui.chart.ITrace2D; 27 import info.monitorenter.gui.chart.TracePoint2D; 28 29 import java.util.Iterator ; 30 import java.util.SortedSet ; 31 import java.util.TreeSet ; 32 33 52 public class Trace2DSorted extends ATrace2D implements ITrace2D { 53 54 protected SortedSet m_points = new TreeSet (); 55 56 60 public Trace2DSorted() { 61 } 63 64 76 protected boolean addPointInternal(final TracePoint2D p) { 77 this.removePoint(p); 79 return this.m_points.add(p); 80 } 81 82 85 public int getMaxSize() { 86 return Integer.MAX_VALUE; 87 } 88 89 92 public int getSize() { 93 return this.m_points.size(); 94 } 95 96 99 public boolean isEmpty() { 100 return this.m_points.size() == 0; 101 } 102 103 106 public Iterator iterator() { 107 return this.m_points.iterator(); 108 } 109 110 113 protected void removeAllPointsInternal() { 114 this.m_points.clear(); 115 } 116 117 120 protected boolean removePointInternal(final TracePoint2D point) { 121 return this.m_points.remove(point); 122 } 123 } 124 | Popular Tags |