# DataManagerSubset (ARX Developer Documentation)

org.deidentifier.arx.framework.data

## Class DataManagerSubset

- java.lang.Object
- - org.deidentifier.arx.framework.data.DataManager
  - - org.deidentifier.arx.framework.data.DataManagerSubset

-     public class DataManagerSubset
      extends DataManager

  A data manager that is projected onto a given subset. Used for post-optimization.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.deidentifier.arx.framework.data.DataManager

      `DataManager.AttributeTypeInternal`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---

    `protected`

    `DataManagerSubset(DataManager source, Data dataAnalyzed, Data dataGeneralized, Data dataStatic, java.lang.String[] header, GeneralizationHierarchy[] hierarchiesGeneralized, int[] hierarchiesHeights, java.util.Map<java.lang.String,GeneralizationHierarchy> hierarchiesSensitive, java.util.Map<java.lang.String,java.lang.Integer> indexesSensitive, int[] maxLevels, DistributionAggregateFunction[] microaggregationFunctions, java.lang.String[] microaggregationHeader, int[] microaggregationMap, int[] microaggregationDomainSizes, int microaggregationNumAttributes, int microaggregationStartIndex, int[] minLevels, java.util.Map<java.lang.String,DataType<?>> dataTypesSensitive)`
    Constructor

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `getDistribution(int[][] data, int index, int distinctValues)` Returns the distribution of the attribute in the data array at the given index.
    `double[]` | `getDistribution(java.lang.String attribute)` Returns the distribution of the given sensitive attribute in the original dataset.
    `int[]` | `getOrder(java.lang.String attribute)` Returns the order of the given sensitive attribute in the original dataset.
    `int[]` | `getTree(int[][] data, int index, int[][] hierarchy)` Returns a tree for the given attribute at the index within the given data array, using the given hierarchy.
    `int[]` | `getTree(java.lang.String attribute)` Returns the tree for the given sensitive attribute, if a generalization hierarchy is associated.

    - ### Methods inherited from class org.deidentifier.arx.framework.data.DataManager

      `getDataAnalyzed, getDataDefinition, getDataGeneralized, getDataStatic, getDomainShares, getHeader, getHierachiesHeights, getHierarchies, getHierarchiesMaxLevels, getHierarchiesMinLevels, getMicroaggregationDomainSizes, getMicroaggregationFunctions, getMicroaggregationHeader, getMicroaggregationMap, getMicroaggregationNumAttributes, getMicroaggregationStartIndex, getSubsetInstance`

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

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

- - ### Constructor Detail

    - #### DataManagerSubset

          protected DataManagerSubset(DataManager source,
                           Data dataAnalyzed,
                           Data dataGeneralized,
                           Data dataStatic,
                           java.lang.String[] header,
                           GeneralizationHierarchy[] hierarchiesGeneralized,
                           int[] hierarchiesHeights,
                           java.util.Map<java.lang.String,GeneralizationHierarchy> hierarchiesSensitive,
                           java.util.Map<java.lang.String,java.lang.Integer> indexesSensitive,
                           int[] maxLevels,
                           DistributionAggregateFunction[] microaggregationFunctions,
                           java.lang.String[] microaggregationHeader,
                           int[] microaggregationMap,
                           int[] microaggregationDomainSizes,
                           int microaggregationNumAttributes,
                           int microaggregationStartIndex,
                           int[] minLevels,
                           java.util.Map<java.lang.String,DataType<?>> dataTypesSensitive)

      Constructor
      Parameters:
        `source` -
        `dataAnalyzed` -
        `dataGeneralized` -
        `dataStatic` -
        `header` -
        `hierarchiesGeneralized` -
        `hierarchiesHeights` -
        `hierarchiesSensitive` -
        `indexesSensitive` -
        `maxLevels` -
        `microaggregationFunctions` -
        `microaggregationHeader` -
        `microaggregationMap` -
        `microaggregationNumAttributes` -
        `microaggregationStartIndex` -
        `minLevels` -
        `dataTypesSensitive` -

  - ### Method Detail

    - #### getDistribution

          public double[] getDistribution(int[][] data,
                                 int index,
                                 int distinctValues)

      Description copied from class: `DataManager`
      Returns the distribution of the attribute in the data array at the given index.
      Overrides:
        `getDistribution` in class `DataManager`
      Returns:

    - #### getDistribution

          public double[] getDistribution(java.lang.String attribute)

      Description copied from class: `DataManager`
      Returns the distribution of the given sensitive attribute in the original dataset. Required for t-closeness.
      Overrides:
        `getDistribution` in class `DataManager`
      Returns:
        distribution

    - #### getOrder

          public int[] getOrder(java.lang.String attribute)

      Description copied from class: `DataManager`
      Returns the order of the given sensitive attribute in the original dataset. Required for t-closeness.
      Overrides:
        `getOrder` in class `DataManager`
      Returns:
        distribution

    - #### getTree

          public int[] getTree(int[][] data,
                      int index,
                      int[][] hierarchy)

      Description copied from class: `DataManager`
      Returns a tree for the given attribute at the index within the given data array, using the given hierarchy. The resulting tree can be used to calculate the earth mover's distance with hierarchical ground-distance.
      Overrides:
        `getTree` in class `DataManager`
      Returns:
        tree

    - #### getTree

          public int[] getTree(java.lang.String attribute)

      Description copied from class: `DataManager`
      Returns the tree for the given sensitive attribute, if a generalization hierarchy is associated. The resulting tree can be used to calculate the earth mover's distance with hierarchical ground-distance.
      Overrides:
        `getTree` in class `DataManager`
      Returns:
        tree