Skip to main content

Pentaho+ documentation is moving!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

Hitachi Vantara Lumada and Pentaho Documentation

Array

pentaho.langBase Array

Extends

Constructor

Name Description
new Array(source)

Initializes a new array of Base.Array class.

Methods

Name Description
to(value, other) : pentaho.lang.Base.Array
Static

Converts a value to an instance of this class, or throws if that is impossible.

Constructor Details

new Array(source)

Initializes a new array of Base.Array class.

If provided, extends the created instance with the spec in source parameter.

Create an instance of Base.Array by using pentaho.lang.Base.Array.to to convert an existing array instance.

Source: javascript/web/pentaho/lang/Base.js, line 183

Parameters:
Name Default Value Summary
source : Array
Optional

An extension specification.

Methods Details

to(value, other) : pentaho.lang.Base.Array
Static

Converts a value to an instance of this class, or throws if that is impossible.

When value is Nully, and empty array instance of this class is created and returned.

When value is an instance of this type, it is returned.

When value is an instance of Array, it converts it to an instance of this array class, by changing it prototype and calling this class' constructor on it, along with the remaining arguments specified. Note that, in this case, value is mutated!

Arrays of a certain sub-class cannot be newed up (in ES5, at least). As such, a normal array must be created first and then "switched" to inheriting from this class: var baseArray = BaseArray.to([]);.

Source: javascript/web/pentaho/lang/Base.js, line 707

Parameters:
Name Default Value Summary
value : pentaho.lang.Base.Array | Array

The value to be converted.

other : *
Repeatable

Remaining arguments passed alongside value to the class constructor.

Returns:
Name Description
pentaho.lang.Base.Array

The converted value.

Throws:
Name Description
Error

When value cannot be converted.