package de.fuberlin.dynhist;

import java.io.Serializable;

/**
* @author Martin Görick
*
* Class to use for a bucket of the histogram.
* It's serializable to save the buckets to a file
*/
public class Bucket implements Serializable {

  private double leftBorder;
  private int count = 0;

  public Bucket(double leftBorder) {
    this.leftBorder = leftBorder;
    incCount();
  }

  public void incCount() {
    count++;
  }

  public int getCount() {
    return count;
  }

  public void setCount(int count) {
    this.count = count;
  }

  public double getLeftBorder() {
    return leftBorder;
  }

  /**
  * leftBorder is round to better readable
  * @param leftBorder
  */
  public void setLeftBorder(double leftBorder) {
    this.leftBorder = Math.round(leftBorder * 100) / 100.0;
  }
}

@@ -178,16 +178,17 @@
 o a file
+.
 %0A*/%0Apubl
@@ -285,16 +285,96 @@
 t = 0;%0A%0A
+  /**%0A   * Constructor for a bucket.%0A   * @param leftBorder of the bucket%0A   */%0A
   public
@@ -463,99 +463,247 @@
 %0A%0A  
-public void incCount() %7B%0A    count++;%0A  %7D%0A%0A  public int getCount() %7B%0A    return count;%0A  %7D%0A
+/**%0A   * Increment count of the bucket.%0A   */%0A  public void incCount() %7B%0A    count++;%0A  %7D%0A%0A  /**%0A   * Returns the count of the bucket.%0A   */%0A  public int getCount() %7B%0A    return count;%0A  %7D%0A%0A  /**%0A   * Set count, it use for partition.%0A   */
 %0A  p
@@ -764,16 +764,58 @@
 t;%0A  %7D%0A%0A
+  /**%0A   * Returns the left border.%0A   */%0A
   public
@@ -881,22 +881,25 @@
 %0A  *
+ Set
  left
-B
+ b
 order
- is
+,
  rou
@@ -923,30 +923,9 @@
 able
-%0A  * @param leftBorder
+.
 %0A  *

add comments