org.deidentifier.arx.aggregates

## Class HierarchyBuilderIntervalBased<T>

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

Type Parameters:
  `T` -

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  DomainShareInterval

    public class HierarchyBuilderIntervalBased<T>
    extends HierarchyBuilderGroupingBased<T>

This class enables building hierarchies for non-categorical values by mapping them into given intervals.

Author:
  Fabian Prasser
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`class` `HierarchyBuilderIntervalBased.IndexNode` This class represents an node.
`static class` `HierarchyBuilderIntervalBased.Interval<T>` This class represents an interval.
`static class` `HierarchyBuilderIntervalBased.Range<U>` For each direction, this class encapsulates three bounds.

### 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
`HierarchyBuilderIntervalBased<T>` `addInterval(T min, T max)` Adds an interval.
`HierarchyBuilderIntervalBased<T>` `addInterval(T min, T max, AggregateFunction<T> function)` Adds an interval.
`HierarchyBuilderIntervalBased<T>` `addInterval(T min, T max, java.lang.String label)` Adds an interval.
`HierarchyBuilderIntervalBased<T>` `clearIntervals()` Adds an interval.
`static <T> HierarchyBuilderIntervalBased<T>` `create(DataType<T> type)` Creates a new instance.
`static <T> HierarchyBuilderIntervalBased<T>` `create(DataType<T> type, HierarchyBuilderIntervalBased.Range<T> lowerRange, HierarchyBuilderIntervalBased.Range<T> upperRange)` Creates a new instance.
`static <T> HierarchyBuilderIntervalBased<T>` `create(java.io.File file)` Loads a builder specification from the given file.
`static <T> HierarchyBuilderIntervalBased<T>` `create(java.lang.String file)` Loads a builder specification from the given file.
`java.util.List<HierarchyBuilderIntervalBased.Interval<T>>` `getIntervals()` Returns all currently defined intervals.
`HierarchyBuilderIntervalBased.Range<T>` `getLowerRange()` Returns the lower range.
`HierarchyBuilderIntervalBased.Range<T>` `getUpperRange()` Returns the upper range.
`java.lang.String` `isValid()` Returns whether the current configuration is valid.

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

`build, build, getDataType, getDefaultFunction, getLevel, getLevels, 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> HierarchyBuilderIntervalBased<T> create(DataType<T> type)

Creates a new instance. Snapping is disabled. Repetition is disabled. Bound is determined dynamically.

Type Parameters:
  `T` -
Parameters:
  `type` -
Returns:

#### create

    public static <T> HierarchyBuilderIntervalBased<T> create(DataType<T> type,
                                                              HierarchyBuilderIntervalBased.Range<T> lowerRange,
                                                              HierarchyBuilderIntervalBased.Range<T> upperRange)

Creates a new instance. Data points that are out of range are handled according to the given settings.

Type Parameters:
  `T` -
Parameters:
  `type` -
  `lowerRange` -
  `upperRange` -
Returns:

#### create

    public static <T> HierarchyBuilderIntervalBased<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> HierarchyBuilderIntervalBased<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`

#### addInterval

    public HierarchyBuilderIntervalBased<T> addInterval(T min,
                                                        T max)

Adds an interval. Min is inclusive, max is exclusive. Uses the predefined default aggregate function

Parameters:
  `min` -
  `max` -
Returns:

#### addInterval

    public HierarchyBuilderIntervalBased<T> addInterval(T min,
                                                        T max,
                                                        AggregateFunction<T> function)

Adds an interval. Min is inclusive, max is exclusive

Parameters:
  `min` -
  `max` -
  `function` -
Returns:

#### addInterval

    public HierarchyBuilderIntervalBased<T> addInterval(T min,
                                                        T max,
                                                        java.lang.String label)

Adds an interval. Min is inclusive, max is exclusive. Interval is labeled with the given string

Parameters:
  `min` -
  `max` -
  `label` -
Returns:

#### clearIntervals

    public HierarchyBuilderIntervalBased<T> clearIntervals()

Adds an interval. Min is inclusive, max is exclusive. Uses the predefined default aggregate function

Returns:

#### getIntervals

    public java.util.List<HierarchyBuilderIntervalBased.Interval<T>> getIntervals()

Returns all currently defined intervals.

Returns:

#### getLowerRange

    public HierarchyBuilderIntervalBased.Range<T> getLowerRange()

Returns the lower range.

Returns:

#### getUpperRange

    public HierarchyBuilderIntervalBased.Range<T> getUpperRange()

Returns the upper range.

Returns:

#### isValid

    public java.lang.String isValid()

Description copied from class: `HierarchyBuilderGroupingBased`
Returns whether the current configuration is valid. Returns `null`, if so, an error message if not.

Overrides:
  `isValid` in class `HierarchyBuilderGroupingBased<T>`
Returns: