# History (ARX Developer Documentation)

org.deidentifier.arx.framework.check.history

## Class History

- java.lang.Object
- - org.deidentifier.arx.framework.check.history.History

-     public class History
      extends java.lang.Object

  The Class History.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `History.StorageStrategy` Two types of storage strategies for the history

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `History(int rowCount, int size, double snapshotSizeDataset, double snapshotSizeSnapshot, ARXConfiguration.ARXConfigurationInternal config, IntArrayDictionary dictionarySensValue, IntArrayDictionary dictionarySensFreq, SolutionSpace solutionSpace)` Creates a new history.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `get(int[] transformation)` Retrieves a snapshot.
    `IntArrayDictionary` | `getDictionarySensFreq()` Method needed for benchmarking.
    `IntArrayDictionary` | `getDictionarySensValue()` Method needed for benchmarking.
    `DependentAction` | `getStorageTrigger()` Returns the current storage strategy.
    `int[]` | `getTransformation()` Returns the node backing the last returned snapshot.
    `void` | `reset()` Clears the history.
    `void` | `setSize(int size)` Sets the size of this history.
    `void` | `setStorageStrategy(History.StorageStrategy strategy)` Sets the storage strategy
    `int` | `size()`
    `boolean` | `store(Transformation transformation, HashGroupify groupify, int[] snapshot)` Stores a snapshot in the buffer.

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

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

- - ### Constructor Detail

    - #### History

          public History(int rowCount,
                 int size,
                 double snapshotSizeDataset,
                 double snapshotSizeSnapshot,
                 ARXConfiguration.ARXConfigurationInternal config,
                 IntArrayDictionary dictionarySensValue,
                 IntArrayDictionary dictionarySensFreq,
                 SolutionSpace solutionSpace)

      Creates a new history.
      Parameters:
        `rowCount` - the row count
        `size` - the max size
        `snapshotSizeDataset` - the snapshotSizeDataset
        `snapshotSizeSnapshot` -
        `config` -
        `dictionarySensValue` -
        `dictionarySensFreq` -
        `solutionSpace` -

  - ### Method Detail

    - #### get

          public int[] get(int[] transformation)

      Retrieves a snapshot.
      Parameters:
        `transformation` -
      Returns:
        snapshot

    - #### getDictionarySensFreq

          public IntArrayDictionary getDictionarySensFreq()

      Method needed for benchmarking.
      Returns:

    - #### getDictionarySensValue

          public IntArrayDictionary getDictionarySensValue()

      Method needed for benchmarking.
      Returns:

    - #### getStorageTrigger

          public DependentAction getStorageTrigger()

      Returns the current storage strategy.
      Returns:

    - #### getTransformation

          public int[] getTransformation()

      Returns the node backing the last returned snapshot.
      Returns:

    - #### reset

          public void reset()

      Clears the history.

    - #### setSize

          public void setSize(int size)

      Sets the size of this history.
      Parameters:
        `size` -

    - #### setStorageStrategy

          public void setStorageStrategy(History.StorageStrategy strategy)

      Sets the storage strategy
      Parameters:
        `strategy` -

    - #### size

          public int size()

      Returns:

    - #### store

          public boolean store(Transformation transformation,
                      HashGroupify groupify,
                      int[] snapshot)

      Stores a snapshot in the buffer.
      Parameters:
        `transformation` - The transformation
        `groupify` - The groupify operator
        `snapshot` - The snapshot that was previously used, if any
      Returns: