Klasse Distribution
java.lang.Object
org.deidentifier.arx.framework.check.distribution.Distribution
This class can be utilized to track the distributions of values. It is backed by a hash table
implementing open addressing with linear probing.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault constructor.Distribution(int[] element, int[] frequency) Constructor used to create frequency set from a history entry. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal voidadd(int element) Adds a element to the hashtable.voidadd(int element, int value) Adds an element with the given frequency.voidclear()Clears the table.int[]Gets all buckets of the hash table.voidmerge(int[] elements, int[] frequency) Merge a frequency set with a history entry.voidmerge(Distribution other) Merges two frequency sets.int[][]pack()Packs the frequency table; removes null values and generates sortedElements and sortedFrequency arrays.intsize()Gets the current size.toString()
-
Konstruktordetails
-
Distribution
public Distribution()Default constructor. -
Distribution
public Distribution(int[] element, int[] frequency) Constructor used to create frequency set from a history entry.- Parameter:
element-frequency-
-
-
Methodendetails
-
add
public final void add(int element) Adds a element to the hashtable. Frequency value 1.- Parameter:
element-
-
add
public void add(int element, int value) Adds an element with the given frequency.- Parameter:
element-value-
-
clear
public void clear()Clears the table. -
getBuckets
public int[] getBuckets()Gets all buckets of the hash table.- Gibt zurück:
-
merge
Merges two frequency sets.- Parameter:
other-
-
merge
public void merge(int[] elements, int[] frequency) Merge a frequency set with a history entry.- Parameter:
elements-frequency-
-
pack
public int[][] pack()Packs the frequency table; removes null values and generates sortedElements and sortedFrequency arrays. In case a collission occured this method also sorts the elements. First entry is elements, second entry is frequencies. -
size
public int size()Gets the current size.- Gibt zurück:
-
toString
-