org.deidentifier.arx.aggregates

## Class HierarchyBuilderOrderBased<T>

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

Type Parameters:
  `T` -

All Implemented Interfaces:
  java.io.Serializable

    public class HierarchyBuilderOrderBased<T>
    extends HierarchyBuilderGroupingBased<T>

This class enables building hierarchies for categorical and non-categorical values by ordering the data items and merging into groups with predefined sizes.

Author:
  Fabian Prasser
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `HierarchyBuilderOrderBased.SerializableComparator<T>` A serializable comparator.

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

`HierarchyBuilderGroupingBased.Group<U>, HierarchyBuilderGroupingBased.Level<U>`

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

`HierarchyBuilder.Type`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static <T> HierarchyBuilderOrderBased<T>` `create(DataType<T> type, boolean order)` Creates a new instance.
`static <T> HierarchyBuilderOrderBased<T>` `create(DataType<T> type, java.util.Comparator<T> comparator)` Creates a new instance.
`static <T> HierarchyBuilderOrderBased<T>` `create(DataType<T> type, java.lang.String[] order)` Creates a new instance.
`static <T> HierarchyBuilderOrderBased<T>` `create(java.io.File file)` Loads a builder specification from the given file.
`static <T> HierarchyBuilderOrderBased<T>` `create(java.lang.String file)` Loads a builder specification from the given file.
`java.util.Comparator<java.lang.String>` `getComparator()` Returns the comparator.

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

`build, build, getDataType, getDefaultFunction, getLevel, getLevels, isValid, prepare, setAggregateFunction`

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

`getType, save, save`

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

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

### Method Detail

#### create

    public static <T> HierarchyBuilderOrderBased<T> create(DataType<T> type,
                                                           boolean order)

Creates a new instance. Either preserves the given order, or sorts the items according to the order induced by the given data type

Type Parameters:
  `T` -
Parameters:
  `type` - The data type is also used for ordering data items
  `order` - Should the items be sorted according to the order induced by the data type
Returns:

#### create

    public static <T> HierarchyBuilderOrderBased<T> create(DataType<T> type,
                                                           java.util.Comparator<T> comparator)

Creates a new instance. Uses the comparator for ordering data items

Type Parameters:
  `T` -
Parameters:
  `type` - The data type
  `comparator` - Use this comparator for ordering data items
Returns:

#### create

    public static <T> HierarchyBuilderOrderBased<T> create(DataType<T> type,
                                                           java.lang.String[] order)

Creates a new instance. Uses the defined order for data items

Type Parameters:
  `T` -
Parameters:
  `type` - The data type
  `order` - Use this for ordering data items
Returns:

#### create

    public static <T> HierarchyBuilderOrderBased<T> create(java.io.File file)
                                                    throws java.io.IOException

Loads a builder specification from the given file.

Type Parameters:
  `T` -
Parameters:
  `file` -
Returns:
Throws:
  `java.io.IOException`

#### create

    public static <T> HierarchyBuilderOrderBased<T> create(java.lang.String file)
                                                    throws java.io.IOException

Loads a builder specification from the given file.

Type Parameters:
  `T` -
Parameters:
  `file` -
Returns:
Throws:
  `java.io.IOException`

#### getComparator

    public java.util.Comparator<java.lang.String> getComparator()

Returns the comparator.

Returns: