# EDDifferentialPrivacy (ARX Developer Documentation)

org.deidentifier.arx.criteria

## Class EDDifferentialPrivacy

- java.lang.Object
- - org.deidentifier.arx.criteria.PrivacyCriterion
  - - org.deidentifier.arx.criteria.ImplicitPrivacyCriterion
    - - org.deidentifier.arx.criteria.EDDifferentialPrivacy

- All Implemented Interfaces:
    java.io.Serializable

      public class EDDifferentialPrivacy
      extends ImplicitPrivacyCriterion

  (e,d)-Differential Privacy implemented with (k,b)-SDGS as proposed in: Ninghui Li, Wahbeh H. Qardaji, Dong Su: On sampling, anonymization, and differential privacy or, k-anonymization meets differential privacy. Proceedings of ASIACCS 2012. pp. 32-33
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EDDifferentialPrivacy(double epsilon, double delta, DataGeneralizationScheme generalization)` Creates a new instance
    `EDDifferentialPrivacy(double epsilon, double delta, DataGeneralizationScheme generalization, boolean deterministic)` Creates a new instance which may be configured to produce deterministic output.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `EDDifferentialPrivacy` | `clone()` Clone
    `double` | `getBeta()` Returns the k parameter of (k,b)-SDGS
    `DataSubset` | `getDataSubset()` If a privacy model uses a data subset, it must overwrite this method
    `double` | `getDelta()` Returns the delta parameter of (e,d)-DP
    `double` | `getEpsilon()` Returns the epsilon parameter of (e,d)-DP
    `DataGeneralizationScheme` | `getGeneralizationScheme()` Returns the defined generalization scheme
    `int` | `getK()` Returns the k parameter of (k,b)-SDGS
    `int` | `getMinimalClassSize()` If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations
    `int` | `getRequirements()` Returns the criterion's requirements.
    `void` | `initialize(DataManager manager, ARXConfiguration config)` Creates a random sample based on beta
    `boolean` | `isAnonymous(Transformation node, HashGroupifyEntry entry)` Implement this, to enforce the criterion.
    `boolean` | `isLocalRecodingSupported()` Returns whether the criterion supports local recoding.
    `boolean` | `isMinimalClassSizeAvailable()` If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations
    `boolean` | `isSubsetAvailable()` If a privacy model uses a data subset, it must overwrite this method
    `ElementData` | `render()` Renders the privacy model
    `java.lang.String` | `toString()` Returns a string representation.

    - ### Methods inherited from class org.deidentifier.arx.criteria.PrivacyCriterion

      `clone, getPopulationModel, getRiskThresholdJournalist, getRiskThresholdMarketer, getRiskThresholdProsecutor, getSubset, isMonotonicWithGeneralization, isMonotonicWithSuppression, isSampleBased`

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

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

- - ### Constructor Detail

    - #### EDDifferentialPrivacy

          public EDDifferentialPrivacy(double epsilon,
                               double delta,
                               DataGeneralizationScheme generalization)

      Creates a new instance
      Parameters:
        `epsilon` -
        `delta` -
        `generalization` -

    - #### EDDifferentialPrivacy

          public EDDifferentialPrivacy(double epsilon,
                               double delta,
                               DataGeneralizationScheme generalization,
                               boolean deterministic)

      Creates a new instance which may be configured to produce deterministic output. Note: *never* use this in production. It is implemented for testing purposes, only.
      Parameters:
        `epsilon` -
        `delta` -
        `generalization` -
        `deterministic` -

  - ### Method Detail

    - #### clone

          public EDDifferentialPrivacy clone()

      Description copied from class: `PrivacyCriterion`
      Clone
      Specified by:
        `clone` in class `PrivacyCriterion`

    - #### getBeta

          public double getBeta()

      Returns the k parameter of (k,b)-SDGS
      Returns:

    - #### getDataSubset

          public DataSubset getDataSubset()

      Description copied from class: `PrivacyCriterion`
      If a privacy model uses a data subset, it must overwrite this method
      Overrides:
        `getDataSubset` in class `PrivacyCriterion`
      Returns:

    - #### getDelta

          public double getDelta()

      Returns the delta parameter of (e,d)-DP
      Returns:

    - #### getEpsilon

          public double getEpsilon()

      Returns the epsilon parameter of (e,d)-DP
      Returns:

    - #### getGeneralizationScheme

          public DataGeneralizationScheme getGeneralizationScheme()

      Returns the defined generalization scheme
      Returns:

    - #### getK

          public int getK()

      Returns the k parameter of (k,b)-SDGS
      Returns:

    - #### getMinimalClassSize

          public int getMinimalClassSize()

      Description copied from class: `PrivacyCriterion`
      If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations
      Overrides:
        `getMinimalClassSize` in class `PrivacyCriterion`
      Returns:

    - #### getRequirements

          public int getRequirements()

      Description copied from class: `PrivacyCriterion`
      Returns the criterion's requirements.
      Specified by:
        `getRequirements` in class `PrivacyCriterion`
      Returns:

    - #### initialize

          public void initialize(DataManager manager,
                        ARXConfiguration config)

      Creates a random sample based on beta
      Overrides:
        `initialize` in class `PrivacyCriterion`
      Parameters:
        `manager` -
        `config` - TODO

    - #### isAnonymous

          public boolean isAnonymous(Transformation node,
                            HashGroupifyEntry entry)

      Description copied from class: `PrivacyCriterion`
      Implement this, to enforce the criterion.
      Specified by:
        `isAnonymous` in class `PrivacyCriterion`
      Parameters:
        `node` - TODO
      Returns:

    - #### isLocalRecodingSupported

          public boolean isLocalRecodingSupported()

      Description copied from class: `PrivacyCriterion`
      Returns whether the criterion supports local recoding.
      Specified by:
        `isLocalRecodingSupported` in class `PrivacyCriterion`
      Returns:

    - #### isMinimalClassSizeAvailable

          public boolean isMinimalClassSizeAvailable()

      Description copied from class: `PrivacyCriterion`
      If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations
      Overrides:
        `isMinimalClassSizeAvailable` in class `PrivacyCriterion`
      Returns:

    - #### isSubsetAvailable

          public boolean isSubsetAvailable()

      Description copied from class: `PrivacyCriterion`
      If a privacy model uses a data subset, it must overwrite this method
      Overrides:
        `isSubsetAvailable` in class `PrivacyCriterion`
      Returns:

    - #### render

          public ElementData render()

      Description copied from class: `PrivacyCriterion`
      Renders the privacy model
      Specified by:
        `render` in class `PrivacyCriterion`
      Returns:

    - #### toString

          public java.lang.String toString()

      Description copied from class: `PrivacyCriterion`
      Returns a string representation.
      Specified by:
        `toString` in class `PrivacyCriterion`