# ARXAnonymizer (ARX API Documentation)

org.deidentifier.arx

## Class ARXAnonymizer

- java.lang.Object
- - org.deidentifier.arx.ARXAnonymizer

-     public class ARXAnonymizer
      extends java.lang.Object

  This class offers several methods to define parameters and execute the ARX algorithm.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ARXAnonymizer()` Creates a new anonymizer with the default configuration.
    `ARXAnonymizer(int historySize, double snapshotSizeDataset, double snapshotSizeSnapshot)` Creates a new anonymizer with the given configuration.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ARXResult` | `anonymize(Data data, ARXConfiguration config)` Performs data anonymization.
    `int` | `getHistorySize()` Returns the maximum number of snapshots allowed to store in the history.
    `double` | `getMaximumSnapshotSizeDataset()` Gets the snapshot size.
    `double` | `getMaximumSnapshotSizeSnapshot()` Gets the snapshot size.
    `int` | `getMaxQuasiIdentifiers()` Returns the maximal number of quasi-identifiers.
    `void` | `setHistorySize(int historySize)` Sets the maximum number of snapshots allowed to store in the history.
    `void` | `setListener(ARXListener listener)` Sets a listener.
    `void` | `setMaximumSnapshotSizeDataset(double snapshotSize)` Sets the maximum size of a snapshot relative to the dataset size.
    `void` | `setMaximumSnapshotSizeSnapshot(double snapshotSizeSnapshot)` Sets the maximum size of a snapshot relative to the previous snapshot.
    `void` | `setMaxQuasiIdentifiers(int maxQuasiIdentifiers)` Sets the maximal number of quasi-identifiers.

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

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

- - ### Constructor Detail

    - #### ARXAnonymizer

          public ARXAnonymizer()

      Creates a new anonymizer with the default configuration.

    - #### ARXAnonymizer

          public ARXAnonymizer(int historySize,
                       double snapshotSizeDataset,
                       double snapshotSizeSnapshot)

      Creates a new anonymizer with the given configuration.
      Parameters:
        `historySize` - The maximum number of snapshots stored in the buffer [default=200]
        `snapshotSizeDataset` - The maximum relative size of a snapshot compared to the dataset [default=0.2]
        `snapshotSizeSnapshot` - The maximum relative size of a snapshot compared to its predecessor [default=0.8]

  - ### Method Detail

    - #### anonymize

          public ARXResult anonymize(Data data,
                            ARXConfiguration config)
                              throws java.io.IOException

      Performs data anonymization.
      Parameters:
        `data` - The data
        `config` - The privacy config
      Returns:
        ARXResult
      Throws:
        `java.io.IOException`

    - #### getHistorySize

          public int getHistorySize()

      Returns the maximum number of snapshots allowed to store in the history.
      Returns:
        The size

    - #### getMaximumSnapshotSizeDataset

          public double getMaximumSnapshotSizeDataset()

      Gets the snapshot size.
      Returns:
        The maximum size of a snapshot relative to the dataset size

    - #### getMaximumSnapshotSizeSnapshot

          public double getMaximumSnapshotSizeSnapshot()

      Gets the snapshot size.
      Returns:
        The maximum size of a snapshot relative to the previous snapshot size

    - #### getMaxQuasiIdentifiers

          public int getMaxQuasiIdentifiers()

      Returns the maximal number of quasi-identifiers.
      Returns:

    - #### setHistorySize

          public void setHistorySize(int historySize)

      Sets the maximum number of snapshots allowed to store in the history.
      Parameters:
        `historySize` - The size

    - #### setListener

          public void setListener(ARXListener listener)

      Sets a listener.
      Parameters:
        `listener` - the new listener, if any

    - #### setMaximumSnapshotSizeDataset

          public void setMaximumSnapshotSizeDataset(double snapshotSize)

      Sets the maximum size of a snapshot relative to the dataset size.
      Parameters:
        `snapshotSize` -

    - #### setMaximumSnapshotSizeSnapshot

          public void setMaximumSnapshotSizeSnapshot(double snapshotSizeSnapshot)

      Sets the maximum size of a snapshot relative to the previous snapshot.
      Parameters:
        `snapshotSizeSnapshot` - The size

    - #### setMaxQuasiIdentifiers

          public void setMaxQuasiIdentifiers(int maxQuasiIdentifiers)

      Sets the maximal number of quasi-identifiers. Set to Integer.MAX_VALUE to disable the restriction. By default, the restriction is disabled.
      Parameters:
        `maxQuasiIdentifiers` -