org.deidentifier.arx.aggregates

## Class HierarchyBuilderGroupingBased<T>

- java.lang.Object
- - org.deidentifier.arx.aggregates.HierarchyBuilder<T>
  - - org.deidentifier.arx.aggregates.HierarchyBuilderGroupingBased<T>

Type Parameters:
  `T` -

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  HierarchyBuilderIntervalBased, HierarchyBuilderOrderBased

    public abstract class HierarchyBuilderGroupingBased<T>
    extends HierarchyBuilder<T>
    implements java.io.Serializable

This abstract base class enables building hierarchies for categorical and non-categorical values.

Author:
  Fabian Prasser
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `HierarchyBuilderGroupingBased.Group<U>` This class represents a fanout parameter.
`static class` `HierarchyBuilderGroupingBased.Level<U>` This class represents a level in the hierarchy.

### Nested classes/interfaces inherited from class org.deidentifier.arx.aggregates.HierarchyBuilder

`HierarchyBuilder.Type`

### Method Summary

All Methods Instance Methods Concrete Methods
`AttributeType.Hierarchy` `build()` Creates a new hierarchy, based on the predefined specification.
`AttributeType.Hierarchy` `build(java.lang.String[] data)` Creates a new hierarchy, based on the predefined specification.
`DataType<T>` `getDataType()` Returns the data type.
`AggregateFunction<T>` `getDefaultFunction()` Returns the default aggregate function.
`HierarchyBuilderGroupingBased.Level<T>` `getLevel(int level)` Returns the given level.
`java.util.List<HierarchyBuilderGroupingBased.Level<T>>` `getLevels()` Returns all currently defined levels.
`java.lang.String` `isValid()` Returns whether the current configuration is valid.
`int[]` `prepare(java.lang.String[] data)` Prepares the builder.
`void` `setAggregateFunction(AggregateFunction<T> function)` Sets the default aggregate function to be used by all fanouts.

### Methods inherited from class org.deidentifier.arx.aggregates.HierarchyBuilder

`create, create, getType, save, save`

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

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

### Method Detail

#### build

    public AttributeType.Hierarchy build()

Creates a new hierarchy, based on the predefined specification.

Specified by:
  `build` in class `HierarchyBuilder<T>`
Returns:

#### build

    public AttributeType.Hierarchy build(java.lang.String[] data)

Creates a new hierarchy, based on the predefined specification.

Specified by:
  `build` in class `HierarchyBuilder<T>`
Parameters:
  `data` -
Returns:

#### getDataType

    public DataType<T> getDataType()

Returns the data type.

Returns:

#### getDefaultFunction

    public AggregateFunction<T> getDefaultFunction()

Returns the default aggregate function.

Returns:

#### getLevel

    public HierarchyBuilderGroupingBased.Level<T> getLevel(int level)

Returns the given level.

Parameters:
  `level` -
Returns:

#### getLevels

    public java.util.List<HierarchyBuilderGroupingBased.Level<T>> getLevels()

Returns all currently defined levels.

Returns:

#### isValid

    public java.lang.String isValid()

Returns whether the current configuration is valid. Returns `null`, if so, an error message if not.

Returns:

#### prepare

    public int[] prepare(java.lang.String[] data)

Prepares the builder. Returns a list of the number of equivalence classes per level

Specified by:
  `prepare` in class `HierarchyBuilder<T>`
Parameters:
  `data` -
Returns:

#### setAggregateFunction

    public void setAggregateFunction(AggregateFunction<T> function)

Sets the default aggregate function to be used by all fanouts.

Parameters:
  `function` -