java.lang.Object
org.deidentifier.arx.framework.check.distribution.Distribution

public class Distribution extends Object
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

    Konstruktoren
    Konstruktor
    Beschreibung
    Default constructor.
    Distribution(int[] element, int[] frequency)
    Constructor used to create frequency set from a history entry.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    final void
    add(int element)
    Adds a element to the hashtable.
    void
    add(int element, int value)
    Adds an element with the given frequency.
    void
    Clears the table.
    int[]
    Gets all buckets of the hash table.
    void
    merge(int[] elements, int[] frequency)
    Merge a frequency set with a history entry.
    void
    Merges two frequency sets.
    int[][]
    Packs the frequency table; removes null values and generates sortedElements and sortedFrequency arrays.
    int
    Gets the current size.
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public void merge(Distribution other)
      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

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object