common
Interface ReferenceHistogram

All Known Implementing Classes:
DefaultReferenceHistogram

public interface ReferenceHistogram

A histogram that represents a partition of a set of references by showing the size of each block in the partition. The references in a block all refer to the same underlying object, identified by an object ID. We are interested in such histograms because the prior probability of a partition of the references depends only on this histogram, not on which particular references refer to which particular objects. In other words, a ReferenceHistogram encapsulates the sufficient statistics for evaluating the probability of a partition. We will sometimes divide the set of references into two subsets, and create a ReferenceHistogram for each subset. The same object IDs may be used in both subset histograms, defining a partition for the entire set where some of the blocks include references from both subsets. So a ReferenceHistogram actually represents a bit more than a histogram: it specifies how to combine this histogram with other histograms. Of course, a ReferenceHistogram also represents less than a partition, in that it doesn't specify which citations are grouped together: it just specifies the group sizes.


Field Summary
static ReferenceHistogram EMPTY_HISTOGRAM
          A ReferenceHistogram with no citations.
 
Method Summary
 int getNumReferences(java.lang.Long obj)
          Returns the number of references for the given object.
 java.util.Iterator iterator()
          Allows iteration over the objects that have at least one reference.
 int numReferencedObjects()
          Returns the number of objects with at least one reference.
 int totalReferences()
          Returns the total number of references in this histogram.
 

Field Detail

EMPTY_HISTOGRAM

static final ReferenceHistogram EMPTY_HISTOGRAM
A ReferenceHistogram with no citations.

Method Detail

numReferencedObjects

int numReferencedObjects()
Returns the number of objects with at least one reference.


totalReferences

int totalReferences()
Returns the total number of references in this histogram.


getNumReferences

int getNumReferences(java.lang.Long obj)
Returns the number of references for the given object. If the object has no references, the method returns zero (rather than throwing an exception or something like that).

Parameters:
obj - a Long object representing an object ID

iterator

java.util.Iterator iterator()
Allows iteration over the objects that have at least one reference.

Returns:
an Iterator over Long objects representing object IDs