Index

Domain

MMO\math\helpers · 1 symbol · generated 30 Sep 2026

class

Domain

Domain.php:10
class MMO\math\helpers\Domain implements MMO\math\interfaces\iDomain, ArrayAccess, IteratorAggregate, Stringable
Namespace
MMO\math\helpers
Implements
iDomain, ArrayAccess, IteratorAggregate, Stringable

Index

ALLOW_ALL
ALLOW_EMPTY
ALLOW_OVERFLOW
ALLOW_SPAN
ALLOW_SPAN_OVERFLOW
ALLOW_THIS_SPAN
ALLOW_VALUE_SPAN
content
add($values)
addStorage($storage)
attach($object, $info)
clear()
Columns($lines) staticFind the common columns between a list of domains
computeLeft($operator, $value)Do an arithmetic operation on the start and end of all the intervals using the value at the start of the computing ($value * $this)
computeRight($operator, $value)Do an arithmetic operation on the start and end of oll the intervals using the value at the end of the computing ($this * $value)
contains($value)Tell if every value of $value is in this domain.
debugName()
exclude($value)Create a new Domain from this one and remove the given values
freeStorage()
From($domains) static
FromValue($value, $isIncluded) static
getEnd()
getIterator($step, $scale, $reverse)
getStart()
includeEnd()
includeStart()
indexOf($interval)
Infinity() static
intersect($value)Create a new Domain of the intersection of this one and the given values
intervals()
inverse($limit)Create a new Domain of the inverse of this one
isEmpty()
isEqual($value)
jsonSerialize()
limit()
match($value, $flags)Match the given value with the current domains.
offsetBy($offset)
offsetExists($offset)\ArrayAccess::offsetExists
offsetGet($offset)\ArrayAccess::offsetGet
offsetSet($offset, $value)\ArrayAccess::offsetSet
offsetUnset($offset)\ArrayAccess::offsetUnset
overlap($value)
remove($values)
set($domains)
size()
union($value)Create a new Domain of the union of this one and the given values
__clone()
__construct($intervals)
__toString()

Constants7

ALLOW_ALL

const ALLOW_ALL = 15

ALLOW_EMPTY

const ALLOW_EMPTY = 8

ALLOW_OVERFLOW

const ALLOW_OVERFLOW = 4

ALLOW_SPAN

const ALLOW_SPAN = 3

ALLOW_SPAN_OVERFLOW

const ALLOW_SPAN_OVERFLOW = 7

ALLOW_THIS_SPAN

const ALLOW_THIS_SPAN = 2

ALLOW_VALUE_SPAN

const ALLOW_VALUE_SPAN = 1

Properties1

content

protected array $content = []
Type
array

Methods41

Columns($lines)

staticDomain.php:82

Find the common columns between a list of domains

static function Columns(self ...$lines): self
See
demo/columns.php
...$linesself
returnsself

computeLeft($operator, $value)

Domain.php:486

Do an arithmetic operation on the start and end of all the intervals using the value at the start of the computing ($value * $this)

function computeLeft(callable $operator, MMO\math\interfaces\iSimpleDomain|int|float $value): static
$operatorcallablefn($a,$b): int|float|null
$valueiSimpleDomain | int | float
returnsstatic

computeRight($operator, $value)

Domain.php:503

Do an arithmetic operation on the start and end of oll the intervals using the value at the end of the computing ($this * $value)

function computeRight(callable $operator, MMO\math\interfaces\iSimpleDomain|int|float $value): static
$operatorcallablefn($a,$b): int|float|null
$valueiSimpleDomain | int | float
returnsstatic

contains($value)

Domain.php:314

Tell if every value of $value is in this domain.

function contains(MMO\math\interfaces\iSimpleDomain|float $value): boolOpen and closed bounds count on both sides, and a value may span touching intervals ([1,2[u[2,3]).
$valueiSimpleDomain | floata single value, or intervals sorted like a Domain's
returnsboolfalse for an empty value, like Interval::contains()
$d = new Domain([1, 2], [3, 4, false]); //[1,2]u]3,4] $d->contains(1.5); //true $d->contains(3.0); //false: ]3,4] excludes 3 $d->contains(new Interval(3, 4, false)); //true $d->contains(new Domain([1, 2], [3.5, 4])); //true

exclude($value)

Domain.php:404

Create a new Domain from this one and remove the given values

function exclude(MMO\math\interfaces\iSimpleDomain|float $value): static
$valueiSimpleDomain | float
returnsstatic

FromValue($value, $isIncluded)

staticDomain.php:33
static function FromValue(float $value, bool $isIncluded = true): static
$valuefloat
$isIncluded = truebool
returnsstatic

getIterator($step, $scale, $reverse)

Domain.php:68
function getIterator(int|float $step = 1, ?int $scale = null, bool $reverse = false): MMO\math\iterators\DomainIterator
$step = 1int | float
$scale = nullnull | int
$reverse = falsebool
returnsDomainIterator

intersect($value)

Domain.php:415

Create a new Domain of the intersection of this one and the given values

function intersect(MMO\math\interfaces\iSimpleDomain|float $value): static
$valueiSimpleDomain | float
returnsstatic

inverse($limit)

Domain.php:449

Create a new Domain of the inverse of this one

function inverse(bool $limit = false): static
$limit = falseboolif true, will preserve the domain's limit
returnsstatic

match($value, $flags)

Domain.php:658

Match the given value with the current domains.

function match(MMO\math\interfaces\iSimpleDomain $value, int $flags = self::ALLOW_ALL): ?array
$valueiSimpleDomain
$flags = self::ALLOW_ALLintcombination of binary flags ALLOW_*
returnsnull | arrayan array where the index is the domain index and the value is a list of value's Interval
0 this [--] [--] [-----] [A] [B] [C] MATCH [[A] , [B] , [C]] [-] [-] NO MATCH [-] [-] [-] NO MATCH [-][-] [-] [-] NO MATCH [---] [-] [-] NO MATCH [--------] [-] NO MATCH [-] [-] [-][-] NO MATCH [---] [-] [-] [-] NO MATCHALLOW_VALUE_SPAN this [--] [----] [---] [-A-] [B] MATCH [[A] , [A] , [B]] [---] [-] [-] NO MATCHALLOW_THIS_SPAN this [------] [---] [A] [B] [C] MATCH [[A,B] , [C]] [----] NO MATCHALLOW_SPAN this [------] [---] [A] [B] [C] MATCH [[A,B] , [C]] [A] [-B--] MATCH [[A,B] , [B]] [-] NO MATCHALLOW_EMPTY this [------] [---] [A] MATCH [[A] , []] [--] [-] NO MATCHALLOW_OVERFLOW this [--] [---] [---] [-A-] [B] [C] MATCH [[A] , [B] , [C]] [------][-] [-] NO MATCHALLOW_SPAN_OVERFLOW this [--] [---] [---] [-A-] [B] [C] MATCH [[A] , [B] , [C]] [-A----][B] [C] MATCH [[A], [A,B], [C]] [---] [-] NO MATCH [-] [-] [-] NO MATCHALLOW_ALL this [--] [---] [---] [-A-] [B] [C] MATCH [[A] , [B] , [C]] [-A----][B] [C] MATCH [[A] , [A,B], [C]] [-A-] [C] MATCH [[A] , [] , [C]] [-] [-] [-] NO MATCH

offsetExists($offset)

Domain.php:760

\ArrayAccess::offsetExists

function offsetExists(mixed $offset): bool
$offsetmixed
returnsbool

offsetSet($offset, $value)

Domain.php:749

\ArrayAccess::offsetSet

function offsetSet(mixed $offset, mixed $value): void
$offsetmixed
$valuemixed
returnsvoid

offsetUnset($offset)

Domain.php:734

\ArrayAccess::offsetUnset

function offsetUnset(mixed $offset): void
$offsetmixed
returnsvoid

union($value)

Domain.php:393

Create a new Domain of the union of this one and the given values

function union(MMO\math\interfaces\iSimpleDomain|float $value): static
$valueiSimpleDomain | float
returnsstatic