org.deidentifier.arx

## Class ARXResult

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

    public class ARXResult
    extends java.lang.Object

Encapsulates the results of an execution of the ARX algorithm.

Author:
  Fabian Prasser, Florian Kohlmayer

### Constructor Summary

Constructors
Constructor and Description
`ARXResult(DataHandle handle, DataDefinition definition, ARXLattice lattice, int historySize, double snapshotSizeSnapshot, double snapshotSizeDataset, Metric<?> metric, ARXConfiguration config, ARXLattice.ARXNode optimum, long time, SolutionSpace<?> solutionSpace, ARXProcessStatistics statistics)` Internal constructor for deserialization.

### Method Summary

All Methods Instance Methods Concrete Methods
`ARXConfiguration` `getConfiguration()` Returns the configuration used.
`DataDefinition` `getDataDefinition()` Returns the data definition
`ARXLattice.ARXNode` `getGlobalOptimum()` Gets the global optimum.
`DataHandle` `getInput()` Returns the associated input handle
`ARXLattice` `getLattice()` Returns the lattice.
`boolean` `getOptimumFound()` Returns whether the global optimum has been found
`DataHandle` `getOutput()` Returns a handle to the data obtained by applying the optimal transformation.
`DataHandle` `getOutput(ARXLattice.ARXNode node)` Returns a handle to data obtained by applying the given transformation.
`DataHandle` `getOutput(ARXLattice.ARXNode node, boolean fork)` Returns a handle to data obtained by applying the given transformation.
`DataHandle` `getOutput(boolean fork)` Returns a handle to the data obtained by applying the optimal transformation.
`DataHandle` `getOutput(java.io.InputStream stream, ARXLattice.ARXNode transformation)` Internal method, not for external use
`ARXProcessStatistics` `getProcessStatistics()` Returns statistics for the anonymization process
`long` `getTime()` Returns the execution time (wall clock).
`boolean` `isOptimizable(DataHandle handle)` Returns whether local recoding can be applied to the given handle
`boolean` `isResultAvailable()` Indicates if a result is available.
`ARXProcessStatistics` `optimize(DataHandle handle)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimize(DataHandle handle, double gsFactor)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimize(DataHandle handle, double gsFactor, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeFast(DataHandle handle, double records)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeFast(DataHandle handle, double records, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeFast(DataHandle handle, double records, double gsFactor, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeIterative(DataHandle handle, double gsFactor, int maxIterations, double adaptionFactor)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeIterative(DataHandle handle, double gsFactor, int maxIterations, double adaptionFactor, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeIterativeFast(DataHandle handle, double records)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeIterativeFast(DataHandle handle, double records, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility
`ARXProcessStatistics` `optimizeIterativeFast(DataHandle handle, double records, double gsFactor, ARXListener listener)` This method optimizes the given data output with local recoding to improve its utility

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

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

### Constructor Detail

#### ARXResult

    public ARXResult(DataHandle handle,
                     DataDefinition definition,
                     ARXLattice lattice,
                     int historySize,
                     double snapshotSizeSnapshot,
                     double snapshotSizeDataset,
                     Metric<?> metric,
                     ARXConfiguration config,
                     ARXLattice.ARXNode optimum,
                     long time,
                     SolutionSpace<?> solutionSpace,
                     ARXProcessStatistics statistics)

Internal constructor for deserialization.

Parameters:
  `handle` -
  `definition` -
  `lattice` -
  `historySize` -
  `snapshotSizeSnapshot` -
  `snapshotSizeDataset` -
  `metric` -
  `config` -
  `optimum` -
  `solutionSpace` -
  `statistics` -

### Method Detail

#### getConfiguration

    public ARXConfiguration getConfiguration()

Returns the configuration used.

Returns:

#### getDataDefinition

    public DataDefinition getDataDefinition()

Returns the data definition

Returns:

#### getGlobalOptimum

    public ARXLattice.ARXNode getGlobalOptimum()

Gets the global optimum.

Returns:
  the global optimum

#### getLattice

    public ARXLattice getLattice()

Returns the lattice.

Returns:

#### getInput

    public DataHandle getInput()

Returns the associated input handle

Returns:

#### getOptimumFound

    public boolean getOptimumFound()

Returns whether the global optimum has been found

Returns:

#### getOutput

    public DataHandle getOutput()

Returns a handle to the data obtained by applying the optimal transformation. This method will fork the buffer, allowing to obtain multiple handles to different representations of the data set. Note that only one instance can be obtained for each transformation.

Returns:

#### getOutput

    public DataHandle getOutput(ARXLattice.ARXNode node)

Returns a handle to data obtained by applying the given transformation. This method will fork the buffer, allowing to obtain multiple handles to different representations of the data set. Note that only one instance can be obtained for each transformation.

Parameters:
  `node` - the transformation
Returns:

#### getOutput

    public DataHandle getOutput(ARXLattice.ARXNode node,
                                boolean fork)

Returns a handle to data obtained by applying the given transformation. This method allows controlling whether the underlying buffer is copied or not. Setting the flag to true will fork the buffer for every handle, allowing to obtain multiple handles to different representations of the data set. When setting the flag to false, all previous handles for output data will be invalidated when a new handle is obtained.

Parameters:
  `node` - the transformation
  `fork` - Set this flag to false, only if you know exactly what you are doing.
Returns:

#### getOutput

    public DataHandle getOutput(boolean fork)

Returns a handle to the data obtained by applying the optimal transformation. This method allows controlling whether the underlying buffer is copied or not. Setting the flag to true will fork the buffer for every handle, allowing to obtain multiple handles to different representations of the data set. When setting the flag to false, all previous handles for output data will be invalidated when a new handle is obtained.

Parameters:
  `fork` - Set this flag to false, only if you know exactly what you are doing.
Returns:

#### getOutput

    public DataHandle getOutput(java.io.InputStream stream,
                                ARXLattice.ARXNode transformation)
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException

Internal method, not for external use

Parameters:
  `stream` -
  `transformation` -
Returns:
Throws:
  `java.io.IOException`
  `java.lang.ClassNotFoundException`

#### getProcessStatistics

    public ARXProcessStatistics getProcessStatistics()

Returns statistics for the anonymization process

Returns:

#### getTime

    public long getTime()

Returns the execution time (wall clock).

Returns:

#### isOptimizable

    public boolean isOptimizable(DataHandle handle)

Returns whether local recoding can be applied to the given handle

Parameters:
  `handle` -
Returns:

#### isResultAvailable

    public boolean isResultAvailable()

Indicates if a result is available.

Returns:

#### optimize

    public ARXProcessStatistics optimize(DataHandle handle)
                                  throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimize

    public ARXProcessStatistics optimize(DataHandle handle,
                                         double gsFactor)
                                  throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimize

    public ARXProcessStatistics optimize(DataHandle handle,
                                         double gsFactor,
                                         ARXListener listener)
                                  throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
  `listener` -
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimizeFast

    public ARXProcessStatistics optimizeFast(DataHandle handle,
                                             double records)
                                      throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized.
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimizeFast

    public ARXProcessStatistics optimizeFast(DataHandle handle,
                                             double records,
                                             ARXListener listener)
                                      throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized.
  `listener` -
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimizeFast

    public ARXProcessStatistics optimizeFast(DataHandle handle,
                                             double records,
                                             double gsFactor,
                                             ARXListener listener)
                                      throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized.
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
  `listener` -
Returns:
  The number of optimized records
Throws:
  `RollbackRequiredException`

#### optimizeIterative

    public ARXProcessStatistics optimizeIterative(DataHandle handle,
                                                  double gsFactor,
                                                  int maxIterations,
                                                  double adaptionFactor)
                                           throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
  `maxIterations` - The maximal number of iterations to perform
  `adaptionFactor` - Is added to the gsFactor when reaching a fixpoint
Throws:
  `RollbackRequiredException`

#### optimizeIterative

    public ARXProcessStatistics optimizeIterative(DataHandle handle,
                                                  double gsFactor,
                                                  int maxIterations,
                                                  double adaptionFactor,
                                                  ARXListener listener)
                                           throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
  `maxIterations` - The maximal number of iterations to perform
  `adaptionFactor` - Is added to the gsFactor when reaching a fixpoint
  `listener` -
Throws:
  `RollbackRequiredException`

#### optimizeIterativeFast

    public ARXProcessStatistics optimizeIterativeFast(DataHandle handle,
                                                      double records)
                                               throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized in each step.
Throws:
  `RollbackRequiredException`

#### optimizeIterativeFast

    public ARXProcessStatistics optimizeIterativeFast(DataHandle handle,
                                                      double records,
                                                      ARXListener listener)
                                               throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized in each step.
  `listener` -
Throws:
  `RollbackRequiredException`

#### optimizeIterativeFast

    public ARXProcessStatistics optimizeIterativeFast(DataHandle handle,
                                                      double records,
                                                      double gsFactor,
                                                      ARXListener listener)
                                               throws RollbackRequiredException

This method optimizes the given data output with local recoding to improve its utility

Parameters:
  `handle` -
  `records` - A fraction [0,1] of records that need to be optimized in each step.
  `gsFactor` - A factor [0,1] weighting generalization and suppression. The default value is 0.5, which means that generalization and suppression will be treated equally. A factor of 0 will favor suppression, and a factor of 1 will favor generalization. The values in between can be used for balancing both methods.
  `listener` -
Throws:
  `RollbackRequiredException`