# Class: Core

## Core()

#### new Core()

MaiaScript core library.

Source:
  - Core.js, line 24

### Methods

#### add(left, right) → {string}

Add two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1194

##### Returns:

An string represening the result of the operation.

Type
  string

#### bitwiseAND(left, right) → {string}

Performs the binary AND operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1056

##### Returns:

An string represening the result of the operation.

Type
  string

#### bitwiseNot(right) → {string}

Performs a binary NOT operation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`right` | object | The right operand.

Source:
  - Core.js, line 1496

##### Returns:

An string represening the result of the operation.

Type
  string

#### bitwiseOR(left, right) → {string}

Performs the binary OR operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1036

##### Returns:

An string represening the result of the operation.

Type
  string

#### bitwiseXOR(left, right) → {string}

Performs the binary XOR operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1046

##### Returns:

An string represening the result of the operation.

Type
  string

#### charAt(str, pos) → {string}

Returns the character at the indicated position.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to look for.
`pos` | number | The character position.

Source:
  - Core.js, line 73

##### Returns:

The character at the indicated position.

Type
  string

#### charCodeAt(str, pos) → {string}

Returns the character code at the indicated position.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to look for.
`pos` | number | The character position.

Source:
  - Core.js, line 83

##### Returns:

The character code at the indicated position.

Type
  string

#### clone(obj) → {string}

Returns a clone of an object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The object to be cloned.

Source:
  - Core.js, line 92

##### Returns:

The clone of the object.

Type
  string

#### complex(real, img) → {number}

Returns a complex number, given the real and imaginary part of the number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`real` | object | TThe real part of the complex number.
`img` | number | The imaginary part of the complex number.

Source:
  - Core.js, line 127

##### Returns:

A complex complex number.

Type
  number

#### concat(mtx1, mtx2) → {array}

Join two matrices.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx1` | array | The first matrix.
`mtx2` | array | The second matrix.

Source:
  - Core.js, line 102

##### Returns:

Matrix containing the two indicated matrices.

Type
  array

#### conj(num) → {number}

Calculates the conjugate of a complex number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`num` | number | The complex number.

Source:
  - Core.js, line 111

##### Returns:

the conjugate of a complex number.

Type
  number

#### copyMatrix(obj) → {array}

Copies a matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | array | Matrix to be copied.

Source:
  - Core.js, line 59

##### Returns:

A copy of the matrix.

Type
  array

#### date() → {object}

Returns a Date object.

Source:
  - Core.js, line 144

##### Returns:

A Date object.

Type
  object

#### det(obj) → {array}

Calculates the determinant matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The matrix to calculate the determinant.

Source:
  - Core.js, line 153

##### Returns:

A (rows x columns) matrix.

Type
  array

#### diag(obj) → {array}

Calculates the diagonal equivalent matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The matrix to calculate the diagonal equivalent matrix.

Source:
  - Core.js, line 198

##### Returns:

A (rows x columns) matrix.

Type
  array

#### different(left, right) → {string}

Returns TRUE if two objects are different.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1124

##### Returns:

An string represening the result of the operation.

Type
  string

#### dim(obj) → {array}

Returns the dimensions of an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | array | Object to be measured.

Source:
  - Core.js, line 236

##### Returns:

Array containing the dimensions of a matrix.

Type
  array

#### div(left, right) → {string}

Divide two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1450

##### Returns:

An string represening the result of the operation.

Type
  string

#### equal(left, right) → {string}

Returns TRUE if two objects are equal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1066

##### Returns:

An string represening the result of the operation.

Type
  string

#### eval(stript, namespace) → {number}

Evaluates a MaiaScript script.

##### Parameters:

Name | Type | Description
--- | --- | ---
`stript` | string | The script to be evaluated.
`namespace` | object | The namespace where evaluate the script.

Source:
  - Core.js, line 256

##### Returns:

Result of the evaluated script.

Type
  number

#### GE(left, right) → {string}

Returns TRUE if the object on the left is greater than or equal to the object on the right.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1154

##### Returns:

An string represening the result of the operation.

Type
  string

#### GT(left, right) → {string}

Returns TRUE if the object on the left is greater than the object on the right.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1164

##### Returns:

An string represening the result of the operation.

Type
  string

#### ident(rows) → {array}

Creates the identity matrix..

##### Parameters:

Name | Type | Description
--- | --- | ---
`rows` | number | Number of rows in the matrix.

Source:
  - Core.js, line 301

##### Returns:

A (rows x rows) identity matrix.

Type
  array

#### imaginary(obj) → {number}

Returns the imaginary part of a complex number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The complex number.

Source:
  - Core.js, line 314

##### Returns:

The imaginary part of a complex number.

Type
  number

#### includes(obj, text) → {boolean}

Returns true if one string is contained in another or in an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The string containing the other one.
`text` | string | Search string.

Source:
  - Core.js, line 334

##### Returns:

True if one string is contained in another or in an array.

Type
  boolean

#### indexOf(str, text) → {number}

Returns the position of one string in another.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string containing the other one.
`text` | string | Search string.

Source:
  - Core.js, line 344

##### Returns:

The position of one string in the other.

Type
  number

#### inv(obj) → {array}

Calculates the inverse matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The matrix to calculate the inverse.

Source:
  - Core.js, line 353

##### Returns:

A (rows x columns) matrix.

Type
  array

#### join(mtx, char) → {string}

Join the elements of an array using the indicated separator.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to join elements.
`char` | string | The separator character.

Source:
  - Core.js, line 402

##### Returns:

The string containing the parts of the array.

Type
  string

#### lastIndexOf(str, text) → {number}

Returns the last position of one string in another.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string containing the other one.
`text` | string | Search string.

Source:
  - Core.js, line 412

##### Returns:

The position of last occurrence of string in the other.

Type
  number

#### LE(left, right) → {string}

Returns TRUE if the object on the left is less than or equal to the object on the right.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1144

##### Returns:

An string represening the result of the operation.

Type
  string

#### leftShift(left, right) → {string}

Performs a left shift operation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1174

##### Returns:

An string represening the result of the operation.

Type
  string

#### length(obj) → {number}

Returns the size of an object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | string | Object to be measured.

Source:
  - Core.js, line 421

##### Returns:

Object size.

Type
  number

#### logicalAND(left, right) → {string}

Performs the logical AND operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1026

##### Returns:

An string represening the result of the operation.

Type
  string

#### logicalNot(right) → {string}

Performs a logical NOT operation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`right` | object | The right operand.

Source:
  - Core.js, line 1505

##### Returns:

An string represening the result of the operation.

Type
  string

#### logicalOR(left, right) → {string}

Performs the logical OR operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1006

##### Returns:

An string represening the result of the operation.

Type
  string

#### logicalXOR(left, right) → {string}

Performs the logical XOR operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1016

##### Returns:

An string represening the result of the operation.

Type
  string

#### LT(left, right) → {string}

Returns TRUE if the object on the left is smaller than the object on the right.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1134

##### Returns:

An string represening the result of the operation.

Type
  string

#### matrix(obj, rows, columns) → {array}

Creates a two-dimensional array (matrix).

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | Object to fill the matrix cells.
`rows` | number | Number of rows in the matrix.
`columns` | number | Number of columns in the matrix.

Source:
  - Core.js, line 432

##### Returns:

A (rows x columns) matrix.

Type
  array

#### mod(left, right) → {string}

Calculates the rest of the division between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1487

##### Returns:

An string represening the result of the operation.

Type
  string

#### mul(left, right) → {string}

Multiplies two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1379

##### Returns:

An string represening the result of the operation.

Type
  string

#### new(obj, properties) → {number}

Creates a new instance of an object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The object that will be used as a template.
`properties` | object | The object properties.

Source:
  - Core.js, line 458

##### Returns:

A new instance of an object.

Type
  number

#### one(rows, columns) → {array}

Creates a unitary matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`rows` | number | Number of rows in the matrix.
`columns` | number | Number of columns in the matrix.

Source:
  - Core.js, line 473

##### Returns:

A (rows x columns) matrix.

Type
  array

#### openSQLDatabase(name, version, displayName, estimatedSize) → {object}

Opens or creates a database.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | Database name.
`version` | string | Scheme version.
`displayName` | string | The display name of the database.
`estimatedSize` | string | Estimated maximum size.

Source:
  - Core.js, line 485

##### Returns:

Reference to the open or created database.

Type
  object

#### pop(mtx, obj) → {array}

Removes an object from the end of an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to join elements.
`obj` | object | The separator character.

Source:
  - Core.js, line 504

##### Returns:

The array with the object removed.

Type
  array

#### power(left, right) → {string}

Performs a power operation between two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1334

##### Returns:

An string represening the result of the operation.

Type
  string

#### push(mtx, obj) → {array}

Insert an object at the end of an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to join elements.
`obj` | object | The separator character.

Source:
  - Core.js, line 514

##### Returns:

The array with the added object.

Type
  array

#### real(obj) → {number}

Returns the real part of a complex number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The complex number.

Source:
  - Core.js, line 523

##### Returns:

The real part of a complex number.

Type
  number

#### regExp(pattern, flags) → {object}

Create a RegExp object to compare an expression with a specified pattern (regular expression).

##### Parameters:

Name | Type | Description
--- | --- | ---
`pattern` | string | The regular expression.
`flags` | string | Indicates the marks that can be added.

Source:
  - Core.js, line 543

##### Returns:

A RegExp object.

Type
  object

#### repeat(str, count) → {string}

Returns a new string with a specified number of copies of the string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | object | The object to convert to do string.
`count` | number | Number of copies.

Source:
  - Core.js, line 554

##### Returns:

A new string with a specified number of copies of the string.

Type
  string

#### replace(str, string1, string2) → {string}

Replaces one character string with another in a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string containing the other one.
`string1` | string | The string to search for.
`string2` | string | The replacement string.

Source:
  - Core.js, line 565

##### Returns:

A new string.

Type
  string

#### rightShift(left, right) → {string}

Performs a left shift operation.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1184

##### Returns:

An string represening the result of the operation.

Type
  string

#### search(str, text) → {number}

Searches a string for a specified value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string containing the other one.
`text` | string | Search string.

Source:
  - Core.js, line 575

##### Returns:

The position of the match.

Type
  number

#### shift(mtx, obj) → {array}

Insert an object at the beginning of an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to join elements.
`obj` | object | The separator character.

Source:
  - Core.js, line 585

##### Returns:

The array with the added object.

Type
  array

#### slice(obj, start, end) → {string}

Return a part of a string or array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | string | The string or array containing the other one.
`start` | number | The start position.
`end` | number | The final position.

Source:
  - Core.js, line 596

##### Returns:

The selected part of the string or array.

Type
  string

#### splice(mtx, pos, count, obj) → {array}

Removes or replaces an object from the specified position in an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to remove elements.
`pos` | number | Position from which objects will be removed.
`count` | number | Number of objects to remove.
`obj` | object | Object to be inserted in the specified location.

Source:
  - Core.js, line 612

##### Returns:

The array with the objects removed.

Type
  array

#### split(str, chars) → {array}

Convert a string to an array, using the character indicated as a separator.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to slit.
`chars` | string | The separator characters.

Source:
  - Core.js, line 626

##### Returns:

The array containing the parts of the string.

Type
  array

#### splitCSV(str, separator, allowRepeatChar, doEval) → {array}

Convert a CSV record to an array, using the character indicated as the column separator.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to slit.
`separator` | string | The separator characters.
`allowRepeatChar` | boolean | The separator character can be repeated (for formatting).
`doEval` | boolean | Run core.eval before adding the column to the record.

Source:
  - Core.js, line 646

##### Returns:

The array containing the parts of the CSV or NULL if the CSV record is not well formed.

Type
  array

#### sub(left, right) → {string}

Subtracts two objects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`left` | object | The left operand.
`right` | object | The right operand.

Source:
  - Core.js, line 1264

##### Returns:

An string represening the result of the operation.

Type
  string

#### substr(str, start, size) → {string}

Return a part of a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string containing the other one.
`start` | number | The start position.
`size` | number | The the size of the slice.

Source:
  - Core.js, line 771

##### Returns:

The selected part of the string.

Type
  string

#### testScript(_script, _times, _value, _tolerance, _catchScript) → {boolean}

Tests a script, checking if the result of its execution corresponds to the expected result, considering the specified tolerance.

##### Parameters:

Name | Type | Description
--- | --- | ---
`_script` | string | The script to be evaluated.
`_times` | number | Number of times the test must be repeated.
`_value` | number | Expected value.
`_tolerance` | number | Tolerance.
`_catchScript` | string | Script to be evaluated if the test fails.

Source:
  - Core.js, line 784

##### Returns:

True if the test was successful or false, otherwise.

Type
  boolean

#### toLowerCase(text) → {string}

Converts a string to lower case.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The string to convert.

Source:
  - Core.js, line 830

##### Returns:

A new string.

Type
  string

#### toNumber(text) → {number}

Converts a string representing a number to a binary number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The string representing a number.

Source:
  - Core.js, line 839

##### Returns:

The string coverted to number.

Type
  number

#### toString(obj, base) → {string}

Converts an objecto to string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | The object to convert to do string.
`base` | number | Numerical base for conversion.

Source:
  - Core.js, line 860

##### Returns:

The object coverted for string.

Type
  string

#### toUpperCase(text) → {string}

Converts a string to uppercase.

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | The string to convert.

Source:
  - Core.js, line 884

##### Returns:

A new string.

Type
  string

#### trim(str, chars) → {string}

Removes characters from the beginning and end of a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to be trimmed
`chars` | string | The characters to remove.

Source:
  - Core.js, line 894

##### Returns:

A new string.

Type
  string

#### trimLeft(str, chars) → {string}

Removes characters from the beginning and end of a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to be trimmed
`chars` | string | The characters to remove.

Source:
  - Core.js, line 913

##### Returns:

A new string.

Type
  string

#### trimRight(str, chars) → {string}

Removes characters from the beginning and end of a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | The string to be trimmed
`chars` | string | The characters to remove.

Source:
  - Core.js, line 932

##### Returns:

A new string.

Type
  string

#### type(obj) → {string}

Returns the class of a MaiaScript object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` | object | A MaiaScript object .

Source:
  - Core.js, line 950

##### Returns:

The class of a MaiaScript object.

Type
  string

#### unshift(mtx, obj) → {array}

Removes an object from the beginning of an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mtx` | array | The array to join elements.
`obj` | object | The separator character.

Source:
  - Core.js, line 982

##### Returns:

The array with the object removed.

Type
  array

#### zero(rows, columns) → {array}

Creates a zero matrix.

##### Parameters:

Name | Type | Description
--- | --- | ---
`rows` | number | Number of rows in the matrix.
`columns` | number | Number of columns in the matrix.

Source:
  - Core.js, line 992

##### Returns:

A (rows x columns) matrix.

Type
  array

#### (inner) init()

Creates the attributes of the class.

Source:
  - Core.js, line 41