ExVEx.Utils.Range (ExVEx v0.2.0)

Copy Markdown View Source

Rectangular cell ranges ("A1:B2" in Excel's notation).

Internally a range is two coordinates — the top-left and bottom-right corners, normalised so that top_left is always the smaller row/column. Swapped corners ("B2:A1") are accepted and normalised.

Summary

Types

t()

@type t() :: %ExVEx.Utils.Range{
  bottom_right: ExVEx.Utils.Coordinate.t(),
  top_left: ExVEx.Utils.Coordinate.t()
}

Functions

anchor(range)

@spec anchor(t()) :: ExVEx.Utils.Coordinate.t()

cells(range)

@spec cells(t()) :: [ExVEx.Utils.Coordinate.t()]

contains?(range, arg)

@spec contains?(t(), ExVEx.Utils.Coordinate.t()) :: boolean()

overlaps?(a, b)

@spec overlaps?(t(), t()) :: boolean()

parse(binary)

@spec parse(String.t()) :: {:ok, t()} | :error

to_string(range)

@spec to_string(t()) :: String.t()