public class Distribution
extends java.lang.Object
Constructor and Description |
---|
Distribution()
Default constructor.
|
Distribution(int[] element,
int[] frequency)
Constructor used to create frequency set from a history entry.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int element)
Adds a element to the hashtable.
|
void |
add(int element,
int value)
Adds an element with the given frequency.
|
void |
clear()
Clears the table.
|
int[] |
getBuckets()
Gets all buckets of the hash table.
|
void |
merge(Distribution other)
Merges two frequency sets.
|
void |
merge(int[] elements,
int[] frequency)
Merge a frequency set with a history entry.
|
int[][] |
pack()
Packs the frequency table; removes null values and generates
sortedElements and sortedFrequency arrays.
|
int |
size()
Gets the current size.
|
java.lang.String |
toString() |
public Distribution()
public Distribution(int[] element, int[] frequency)
element
- frequency
- public final void add(int element)
element
- public void add(int element, int value)
element
- value
- public void clear()
public int[] getBuckets()
public void merge(Distribution other)
other
- public void merge(int[] elements, int[] frequency)
elements
- frequency
- public int[][] pack()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object