1 38 39 package org.jfree.data; 40 41 46 class HistogramBin { 47 48 49 private int count = 0; 50 51 52 private double startBoundary; 53 54 55 private double endBoundary; 56 57 63 HistogramBin(double startBoundary, double endBoundary) { 64 if (startBoundary > endBoundary) { 65 throw new IllegalArgumentException ( 66 "HistogramBin(...): startBoundary > endBoundary." 67 ); 68 } 69 this.startBoundary = startBoundary; 70 this.endBoundary = endBoundary; 71 } 72 73 78 public int getCount() { 79 return count; 80 } 81 82 85 public void incrementCount() { 86 count++; 87 } 88 89 94 public double getStartBoundary() { 95 return startBoundary; 96 } 97 98 103 public double getEndBoundary() { 104 return endBoundary; 105 } 106 107 112 public double getBinWidth() { 113 return endBoundary - startBoundary; 114 } 115 116 } 117 | Popular Tags |