org.deidentifier.arx.framework.check.groupify

## Class HashGroupify

- java.lang.Object
- - org.deidentifier.arx.framework.check.groupify.HashGroupify

    public class HashGroupify
    extends java.lang.Object

A hash groupify operator. It implements a hash table with chaining and keeps track of additional properties per equivalence class

Author:
  Fabian Prasser, Florian Kohlmayer

### Constructor Summary

Constructors
Constructor and Description
`HashGroupify(int capacity, ARXConfiguration.ARXConfigurationInternal config, int dataAnalyzedNumberOfColumns, DataMatrix input, DataMatrix output, DataMatrix analyzed, int[] suppressedCodes)` Constructs a new hash groupify operator.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addFromBuffer(int generalized, int other, int representative, int count, int pcount)` Adds a tuple from the buffer
`void` `addFromGroupify(int generalized, Distribution[] distributions, int representative, int count, int pcount)` Adds an entry from another groupify operator
`void` `addFromSnapshot(int generalized, int[][] elements, int[][] frequencies, int representative, int count, int pcount)` Adds a class from a snapshot
`HashGroupifyEntry` `getEntry(int[] tuple)` Returns the entry for the given tuple
`HashGroupifyEntry` `getFirstEquivalenceClass()` Returns the first entry
`DataMatrix` `getInputData()` Returns the input data matrix
`int` `getNumberOfEquivalenceClasses()` Returns the current size in terms of classes
`DataMatrix` `getOutputData()` Returns the output data
`boolean` `isCompletelyGeneralized(HashGroupifyEntry entry)` Returns whether the given entry is completely generalized
`boolean` `isMinimalClassSizeFulfilled()` Returns whether the current state of the dataset fulfills the minimal class-size property
`boolean` `isPrivacyModelFulfilled()` Returns whether the current state of the dataset fulfills the privacy model
`Data` `performMicroaggregation(DataAggregationInformation microaggregationData, Dictionary dictionary)` Returns a data object with microaggregation performed
`void` `performSuppression()` Suppresses all records in the output dataset which (a) do not satisfy privacy requirements, or (b) are not included in the research subset
`void` `stateAnalyze(Transformation<?> transformation, boolean force)` Analyzes the current state
`void` `stateClear()` Clears all entries
`void` `stateResetSuppression()` This method will reset all flags that indicate that equivalence classes are suppressed.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HashGroupify

    public HashGroupify(int capacity,
                        ARXConfiguration.ARXConfigurationInternal config,
                        int dataAnalyzedNumberOfColumns,
                        DataMatrix input,
                        DataMatrix output,
                        DataMatrix analyzed,
                        int[] suppressedCodes)

Constructs a new hash groupify operator.

Parameters:
  `capacity` - The capacity
  `aggregation` - The aggregation information
  `config` - The config
  `input` -
  `output` -
  `analyzed` -
  `suppressedCodes` -

### Method Detail

#### addFromBuffer

    public void addFromBuffer(int generalized,
                              int other,
                              int representative,
                              int count,
                              int pcount)

Adds a tuple from the buffer

Parameters:
  `generalized` -
  `other` -
  `representative` -
  `count` -
  `pcount` -

#### addFromGroupify

    public void addFromGroupify(int generalized,
                                Distribution[] distributions,
                                int representative,
                                int count,
                                int pcount)

Adds an entry from another groupify operator

Parameters:
  `generalized` -
  `distributions` -
  `representative` -
  `count` -
  `pcount` -

#### addFromSnapshot

    public void addFromSnapshot(int generalized,
                                int[][] elements,
                                int[][] frequencies,
                                int representative,
                                int count,
                                int pcount)

Adds a class from a snapshot

Parameters:
  `generalized` -
  `elements` -
  `frequencies` -
  `representative` -
  `count` -
  `pcount` -

#### getEntry

    public HashGroupifyEntry getEntry(int[] tuple)

Returns the entry for the given tuple

Parameters:
  `tuple` -
Returns:

#### getFirstEquivalenceClass

    public HashGroupifyEntry getFirstEquivalenceClass()

Returns the first entry

Returns:

#### getInputData

    public DataMatrix getInputData()

Returns the input data matrix

Returns:

#### getNumberOfEquivalenceClasses

    public int getNumberOfEquivalenceClasses()

Returns the current size in terms of classes

Returns:

#### getOutputData

    public DataMatrix getOutputData()

Returns the output data

Returns:

#### isCompletelyGeneralized

    public boolean isCompletelyGeneralized(HashGroupifyEntry entry)

Returns whether the given entry is completely generalized

Parameters:
  `entry` -
Returns:

#### isMinimalClassSizeFulfilled

    public boolean isMinimalClassSizeFulfilled()

Returns whether the current state of the dataset fulfills the minimal class-size property

Returns:

#### isPrivacyModelFulfilled

    public boolean isPrivacyModelFulfilled()

Returns whether the current state of the dataset fulfills the privacy model

Returns:

#### performMicroaggregation

    public Data performMicroaggregation(DataAggregationInformation microaggregationData,
                                        Dictionary dictionary)

Returns a data object with microaggregation performed

Parameters:
  `microaggregationData` -
  `dictionary` -
Returns:

#### performSuppression

    public void performSuppression()

Suppresses all records in the output dataset which
(a) do not satisfy privacy requirements, or
(b) are not included in the research subset

Parameters:
  `dictionary` -

#### stateAnalyze

    public void stateAnalyze(Transformation<?> transformation,
                             boolean force)

Analyzes the current state

Parameters:
  `transformation` -
  `force` -

#### stateClear

    public void stateClear()

Clears all entries

#### stateResetSuppression

    public void stateResetSuppression()

This method will reset all flags that indicate that equivalence classes are suppressed.