AutoArchive._infrastructure.utils.interval — AutoArchive Developer Manual (ver. 2.0.2)

# AutoArchive._infrastructure.utils.interval

Operations with interval of integers.

## Modules

### interval

`Interval` class.

class AutoArchive._infrastructure.utils.interval.interval.Interval(min: AutoArchive._infrastructure.utils.interval.interval.T, max: AutoArchive._infrastructure.utils.interval.interval.T)

  Bases: `Generic`[`AutoArchive._infrastructure.utils.interval.interval.T`]

  Interval of numbers.

  Parameters

    - min – The lower bound.

    - max – The upper bound.

  property max: AutoArchive._infrastructure.utils.interval.interval.T

    Upper bound.

  property min: AutoArchive._infrastructure.utils.interval.interval.T

    Lower bound.

### interval_element

`IntervalElement` class.

class AutoArchive._infrastructure.utils.interval.interval_element.IntervalElement(value: int, interval: AutoArchive._infrastructure.utils.interval.interval.Interval[int])

  Bases: `object`

  An element from a numeric interval.

  It is possible to specify value outside of the defined interval. The behavior is undefined in this case.

  Parameters

    - value – The number from `interval`.

    - interval – The interval the `value` is from.

  remapTo(targetInterval: AutoArchive._infrastructure.utils.interval.interval.Interval[int])

    Returns new element which is this element remapped to a target interval.

    Examples:

    > element = 5, self.__interval = <0, 10>, targetInterval = <0, 100> => 50 element = 9, self.__interval = <1, 9>, targetInterval = <1, 19> => 19

    Parameters

      targetInterval – Interval which this element shall be remapped to.

    Returns

      Element from the target interval `targetInterval`.

  property value: int

    Value of the element.