Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Private Attributes
Histogram Class Reference

Provides a simple way to tally the occurrence of unique objects. More...

Collaboration diagram for Histogram:
Collaboration graph
[legend]

List of all members.

Classes

class  Bin

Public Member Functions

void record (Object object)
Object[] objects ()
int count (Object object)

Private Attributes

Hashtable bins = new Hashtable()

Detailed Description

Provides a simple way to tally the occurrence of unique objects.

Definition at line 43 of file Histogram.java.


Member Function Documentation

int Histogram.count ( Object  object) [inline]

Definition at line 68 of file Histogram.java.

                                       {
              Bin bin = (Bin) bins.get(object);
              if (bin != null)
                     return bin.count;
              else
                     return 0;
       }

Here is the caller graph for this function:

Object [] Histogram.objects ( ) [inline]

Definition at line 59 of file Histogram.java.

                                 {
              int count = bins.size();
              Object[] objects = new Object[count];
              Enumeration e = bins.keys();
              while (e.hasMoreElements())
                     objects[--count] = e.nextElement();
              return objects;
       }

Here is the call graph for this function:

void Histogram.record ( Object  object) [inline]

Definition at line 50 of file Histogram.java.

                                         {
              Bin bin = (Bin) bins.get(object);
              if (bin == null) {
                     bin = new Bin();
                     bins.put(object, bin);
              }
              ++bin.count;
       }

Here is the caller graph for this function:


Member Data Documentation

Hashtable Histogram.bins = new Hashtable() [private]

Definition at line 48 of file Histogram.java.


The documentation for this class was generated from the following file: