# DataDefinition (ARX GUI Documentation)

org.deidentifier.arx

## Class DataDefinition

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

- All Implemented Interfaces:
    java.lang.Cloneable

      public class DataDefinition
      extends java.lang.Object
      implements java.lang.Cloneable

  Encapsulates a definition of the types of attributes contained in a dataset.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataDefinition()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataDefinition` | `clone()`
    `AttributeType` | `getAttributeType(java.lang.String attribute)` Returns the type defined for the attribute.
    `DataType<?>` | `getDataType(java.lang.String columnName)` Returns the data type for the given column.
    `java.lang.String[][]` | `getHierarchy(java.lang.String attribute)` Returns the according hierarchy as String array.
    `HierarchyBuilder<?>` | `getHierarchyBuilder(java.lang.String attribute)` Returns the associated builder, if any.
    `AttributeType.Hierarchy` | `getHierarchyObject(java.lang.String attribute)` Returns the according hierarchy object.
    `java.util.Set<java.lang.String>` | `getIdentifyingAttributes()` Returns the direct identifiers.
    `java.util.Set<java.lang.String>` | `getInsensitiveAttributes()` Returns the insensitive attributes.
    `int` | `getMaximumGeneralization(java.lang.String attribute)` Returns the maximum generalization for the attribute.
    `AttributeType.MicroAggregationFunction` | `getMicroAggregationFunction(java.lang.String attribute)` Returns the according microaggregation function.
    `int` | `getMinimumGeneralization(java.lang.String attribute)` Returns the minimum generalization for the attribute.
    `java.util.Set<java.lang.String>` | `getQuasiIdentifiersWithGeneralization()` Returns the quasi-identifiers for which generalization is specified.
    `java.util.Set<java.lang.String>` | `getQuasiIdentifiersWithMicroaggregation()` Returns the quasi-identifiers for which microaggregation is specified.
    `java.util.Set<java.lang.String>` | `getQuasiIdentifyingAttributes()` Returns the quasi identifying attributes.
    `java.util.Set<java.lang.String>` | `getSensitiveAttributes()` Returns the sensitive attributes.
    `boolean` | `isHierarchyAvailable(java.lang.String attribute)` Returns whether a hierarchy is available.
    `boolean` | `isHierarchyBuilderAvailable(java.lang.String attribute)` Returns whether a hierarchy builder is available.
    `boolean` | `isLocked()` Returns whether this definition can be altered.
    `boolean` | `isMaximumGeneralizationAvailable(java.lang.String attribute)` Returns whether a maximum generalization level is available.
    `boolean` | `isMinimumGeneralizationAvailable(java.lang.String attribute)` Returns whether a minimum generalization level is available.
    `protected void` | `materializeHierarchies(DataHandle handle)` Materializes all functional hierarchies.
    `protected void` | `parse(ImportAdapter adapter)` Parses the configuration of the import adapter.
    `void` | `read(DataDefinition other)` Reads all settings from the given definition
    `java.util.List<ElementData>` | `render()` Renders this object
    `void` | `resetAttributeType(java.lang.String attr)` Resets the according setting
    `void` | `resetHierarchy(java.lang.String attr)` Resets the according setting
    `void` | `resetHierarchyBuilder(java.lang.String attr)` Resets the according setting
    `void` | `resetMaximumGeneralization(java.lang.String attr)` Resets the according setting
    `void` | `resetMicroAggregationFunction(java.lang.String attr)` Resets the according setting
    `void` | `resetMinimumGeneralization(java.lang.String attr)` Resets the according setting
    `void` | `setAttributeType(java.lang.String attribute, AttributeType type)` Define the type of a given attribute.
    `void` | `setAttributeType(java.lang.String attribute, HierarchyBuilder<?> builder)` Defines the given attribute as a quasi-identifier and stores the functional representation of the generalization hierarchy.
    `void` | `setDataType(java.lang.String attribute, DataType<?> type)` Define the datatype of a given attribute.
    `void` | `setHierarchy(java.lang.String attribute, AttributeType.Hierarchy hierarchy)` Associates the given hierarchy
    `void` | `setHierarchy(java.lang.String attribute, HierarchyBuilder<?> builder)` Associates the given hierarchy builder
    `protected void` | `setLocked(boolean locked)` Lock/unlock the definition.
    `void` | `setMaximumGeneralization(java.lang.String attribute, int maximum)` Define the maximal generalization of a given attribute.
    `void` | `setMicroAggregationFunction(java.lang.String attribute, AttributeType.MicroAggregationFunction function)` Associates the given microaggregation function
    `void` | `setMinimumGeneralization(java.lang.String attribute, int minimum)` Define the minimal generalization of a given attribute.

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

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

- - ### Constructor Detail

    - #### DataDefinition

          public DataDefinition()

  - ### Method Detail

    - #### clone

          public DataDefinition clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### getAttributeType

          public AttributeType getAttributeType(java.lang.String attribute)

      Returns the type defined for the attribute.
      Parameters:
        `attribute` -
      Returns:

    - #### getDataType

          public DataType<?> getDataType(java.lang.String columnName)

      Returns the data type for the given column.
      Parameters:
        `columnName` -
      Returns:

    - #### getHierarchy

          public java.lang.String[][] getHierarchy(java.lang.String attribute)

      Returns the according hierarchy as String array.
      Parameters:
        `attribute` -
      Returns:

    - #### getHierarchyBuilder

          public HierarchyBuilder<?> getHierarchyBuilder(java.lang.String attribute)

      Returns the associated builder, if any.
      Parameters:
        `attribute` -
      Returns:

    - #### getHierarchyObject

          public AttributeType.Hierarchy getHierarchyObject(java.lang.String attribute)

      Returns the according hierarchy object.
      Parameters:
        `attribute` -
      Returns:

    - #### getIdentifyingAttributes

          public java.util.Set<java.lang.String> getIdentifyingAttributes()

      Returns the direct identifiers.
      Returns:

    - #### getInsensitiveAttributes

          public java.util.Set<java.lang.String> getInsensitiveAttributes()

      Returns the insensitive attributes.
      Returns:

    - #### getMaximumGeneralization

          public int getMaximumGeneralization(java.lang.String attribute)

      Returns the maximum generalization for the attribute.
      Parameters:
        `attribute` -
      Returns:

    - #### getMicroAggregationFunction

          public AttributeType.MicroAggregationFunction getMicroAggregationFunction(java.lang.String attribute)

      Returns the according microaggregation function.
      Parameters:
        `attribute` -
      Returns:

    - #### getMinimumGeneralization

          public int getMinimumGeneralization(java.lang.String attribute)

      Returns the minimum generalization for the attribute.
      Parameters:
        `attribute` -
      Returns:

    - #### getQuasiIdentifiersWithGeneralization

          public java.util.Set<java.lang.String> getQuasiIdentifiersWithGeneralization()

      Returns the quasi-identifiers for which generalization is specified.
      Returns:

    - #### getQuasiIdentifiersWithMicroaggregation

          public java.util.Set<java.lang.String> getQuasiIdentifiersWithMicroaggregation()

      Returns the quasi-identifiers for which microaggregation is specified.
      Returns:

    - #### getQuasiIdentifyingAttributes

          public java.util.Set<java.lang.String> getQuasiIdentifyingAttributes()

      Returns the quasi identifying attributes.
      Returns:

    - #### getSensitiveAttributes

          public java.util.Set<java.lang.String> getSensitiveAttributes()

      Returns the sensitive attributes.
      Returns:

    - #### isHierarchyAvailable

          public boolean isHierarchyAvailable(java.lang.String attribute)

      Returns whether a hierarchy is available.
      Parameters:
        `attribute` -
      Returns:

    - #### isHierarchyBuilderAvailable

          public boolean isHierarchyBuilderAvailable(java.lang.String attribute)

      Returns whether a hierarchy builder is available.
      Parameters:
        `attribute` -
      Returns:

    - #### isLocked

          public boolean isLocked()

      Returns whether this definition can be altered.
      Returns:

    - #### isMaximumGeneralizationAvailable

          public boolean isMaximumGeneralizationAvailable(java.lang.String attribute)

      Returns whether a maximum generalization level is available.
      Parameters:
        `attribute` -
      Returns:

    - #### isMinimumGeneralizationAvailable

          public boolean isMinimumGeneralizationAvailable(java.lang.String attribute)

      Returns whether a minimum generalization level is available.
      Parameters:
        `attribute` -
      Returns:

    - #### read

          public void read(DataDefinition other)

      Reads all settings from the given definition
      Parameters:
        `definition` -

    - #### render

          public java.util.List<ElementData> render()

      Renders this object
      Returns:

    - #### resetAttributeType

          public void resetAttributeType(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### resetHierarchy

          public void resetHierarchy(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### resetHierarchyBuilder

          public void resetHierarchyBuilder(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### resetMaximumGeneralization

          public void resetMaximumGeneralization(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### resetMicroAggregationFunction

          public void resetMicroAggregationFunction(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### resetMinimumGeneralization

          public void resetMinimumGeneralization(java.lang.String attr)

      Resets the according setting
      Parameters:
        `attr` -

    - #### setAttributeType

          public void setAttributeType(java.lang.String attribute,
                              AttributeType type)

      Define the type of a given attribute.
      Parameters:
        `attribute` -
        `type` -

    - #### setAttributeType

          public void setAttributeType(java.lang.String attribute,
                              HierarchyBuilder<?> builder)

      Defines the given attribute as a quasi-identifier and stores the functional representation of the generalization hierarchy.
      Parameters:
        `attribute` -
        `builder` -

    - #### setDataType

          public void setDataType(java.lang.String attribute,
                         DataType<?> type)

      Define the datatype of a given attribute.
      Parameters:
        `attribute` -
        `type` -

    - #### setHierarchy

          public void setHierarchy(java.lang.String attribute,
                          AttributeType.Hierarchy hierarchy)

      Associates the given hierarchy
      Parameters:
        `attribute` -
        `hierarchy` -

    - #### setHierarchy

          public void setHierarchy(java.lang.String attribute,
                          HierarchyBuilder<?> builder)

      Associates the given hierarchy builder
      Parameters:
        `attribute` -
        `builder` -

    - #### setMaximumGeneralization

          public void setMaximumGeneralization(java.lang.String attribute,
                                      int maximum)

      Define the maximal generalization of a given attribute.
      Parameters:
        `attribute` -
        `maximum` -

    - #### setMicroAggregationFunction

          public void setMicroAggregationFunction(java.lang.String attribute,
                                         AttributeType.MicroAggregationFunction function)

      Associates the given microaggregation function
      Parameters:
        `attribute` -
        `builder` -

    - #### setMinimumGeneralization

          public void setMinimumGeneralization(java.lang.String attribute,
                                      int minimum)

      Define the minimal generalization of a given attribute.
      Parameters:
        `attribute` -
        `minimum` -

    - #### materializeHierarchies

          protected void materializeHierarchies(DataHandle handle)

      Materializes all functional hierarchies.
      Parameters:
        `handle` -

    - #### parse

          protected void parse(ImportAdapter adapter)

      Parses the configuration of the import adapter.
      Parameters:
        `adapter` -

    - #### setLocked

          protected void setLocked(boolean locked)

      Lock/unlock the definition.
      Parameters:
        `locked` -