Added size() that returns the total number of values present in the
histogram. git-svn-id: https://samskivert.googlecode.com/svn/trunk@709 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: Histogram.java,v 1.1 2002/02/18 06:22:56 mdb Exp $
|
||||
// $Id: Histogram.java,v 1.2 2002/04/22 17:33:09 shaper Exp $
|
||||
//
|
||||
// samskivert library - useful routines for java programs
|
||||
// Copyright (C) 2001 Michael Bayne
|
||||
@@ -55,6 +55,14 @@ public class Histogram
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number of values in the histogram.
|
||||
*/
|
||||
public int size ()
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the values from this histogram.
|
||||
*/
|
||||
@@ -94,6 +102,9 @@ public class Histogram
|
||||
/** The size of each histogram bucket. */
|
||||
protected int _bucketWidth;
|
||||
|
||||
/** The total number of values. */
|
||||
protected int _count;
|
||||
|
||||
/** The histogram buckets. */
|
||||
protected int[] _buckets;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user