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.

Author:
  Fabian Prasser, Florian Kohlmayer

### Constructor Summary

Constructors
Constructor and Description
`DataDefinition()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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>` `getQuasiIdentifiersWithClusteringAndMicroaggregation()` Returns the quasi-identifiers for which clustering and microaggregation has been specified.
`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>` `getResponseVariables()` Returns the set of defined response variables
`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.
`boolean` `isResponseVariable(java.lang.String attribute)` Returns whether the given attribute is a response variable
`void` `read(DataDefinition other)` Reads all settings from the given definition
`java.util.List<ElementData>` `render()` Renders this object
`void` `resetAttributeType(java.lang.String attribute)` Resets the according setting
`void` `resetHierarchy(java.lang.String attribute)` Resets the according setting
`void` `resetHierarchyBuilder(java.lang.String attribute)` Resets the according setting
`void` `resetMaximumGeneralization(java.lang.String attribute)` Resets the according setting
`void` `resetMicroAggregationFunction(java.lang.String attribute)` Resets the according setting
`void` `resetMinimumGeneralization(java.lang.String attribute)` 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
`void` `setMaximumGeneralization(java.lang.String attribute, int maximumLevel)` Define the maximal generalization of a given attribute.
`void` `setMicroAggregationFunction(java.lang.String attribute, AttributeType.MicroAggregationFunction function)` Associates the given microaggregation function.
`void` `setMicroAggregationFunction(java.lang.String attribute, AttributeType.MicroAggregationFunction function, boolean performClustering)` Associates the given microaggregation function
`void` `setMinimumGeneralization(java.lang.String attribute, int minimumLevel)` Define the minimal generalization of a given attribute.
`void` `setResponseVariable(java.lang.String attribute, boolean value)` Sets whether the given attribute is a response variable

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

`equals, 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:

#### getQuasiIdentifiersWithClusteringAndMicroaggregation

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

Returns the quasi-identifiers for which clustering and microaggregation has been specified. The result of this method is a subset of the attributes returned by `getQuasiIdentifiersWithMicroaggregation()`.

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:

#### getResponseVariables

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

Returns the set of defined response variables

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:

#### isResponseVariable

    public boolean isResponseVariable(java.lang.String attribute)

Returns whether the given attribute is a response variable

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 attribute)

Resets the according setting

Parameters:
  `attribute` -

#### resetHierarchy

    public void resetHierarchy(java.lang.String attribute)

Resets the according setting

Parameters:
  `attribute` -

#### resetHierarchyBuilder

    public void resetHierarchyBuilder(java.lang.String attribute)

Resets the according setting

Parameters:
  `attribute` -

#### resetMaximumGeneralization

    public void resetMaximumGeneralization(java.lang.String attribute)

Resets the according setting

Parameters:
  `attribute` -

#### resetMicroAggregationFunction

    public void resetMicroAggregationFunction(java.lang.String attribute)

Resets the according setting

Parameters:
  `attribute` -

#### resetMinimumGeneralization

    public void resetMinimumGeneralization(java.lang.String attribute)

Resets the according setting

Parameters:
  `attribute` -

#### 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 maximumLevel)

Define the maximal generalization of a given attribute.

Parameters:
  `attribute` -
  `maximumLevel` -

#### setMicroAggregationFunction

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

Associates the given microaggregation function. When configuring microaggregation with this method generalization hierarchies will not be used for clustering attribute values before aggregation.

Parameters:
  `attribute` -
  `function` -

#### setMicroAggregationFunction

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

Associates the given microaggregation function

Parameters:
  `attribute` -
  `function` -
  `performClustering` - When set to true, available generalization hierarchies will be used for clustering attribute values before aggregation.

#### setMinimumGeneralization

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

Define the minimal generalization of a given attribute.

Parameters:
  `attribute` -
  `minimumLevel` -

#### setResponseVariable

    public void setResponseVariable(java.lang.String attribute,
                                    boolean value)

Sets whether the given attribute is a response variable

Parameters:
  `attribute` -
  `value` -