Skip to main content
Pentaho Documentation

Array

pentaho.lang.Base.Array

Extends

  • Array

Constructor

Name Description
new Array(source)
 
Static

Initializes a new array of Base.Array class.

Members

Name Description
ancestor
 
Static

The ancestor class.

base : function
 
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Methods

Name Description
_extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static
 
Protected

Actually creates a subclass of this one.

_subclassed(Subclass, instSpec, classSpec, keyArgs)
 
Static
 
Protected

Called when a subclass of this class has been created.

extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static

Creates a subclass of this one.

implement(instSpecs) : !Class.<pentaho.lang.Base> | function
 
Static

Adds instance specifications to this class.

implementStatic(classSpecs) : !Class.<pentaho.lang.Base> | function
 
Static

Adds static specifications to this class.

mix(instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static

Adds additional members to, or overrides existing ones of, this class.

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

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

extend(source, keyArgs) : Object

Extend an object with the properties of another.

Constructor Details

new Array(source)
 
Static

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 170

Parameters:
Name Default Value Summary
source : Array
 
Optional

An extension specification.

Members Details

ancestor:
 
Static

The ancestor class.

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

base: function
 
Protected

If a method has been overridden, then the base method provides access to the overridden method.

Can also be called from within a constructor function.

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

Methods Details

_extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static
 
Protected

Actually creates a subclass of this one.

The default implementation creates the subclass constructor, inherits static members and handles the special instSpec.extend_exclude and instSpec.extend_order properties. Then, it delegates the remainder of the subclass setup to the _subclassed, whose default implementation mixes-in the given instance and class specifications. Finally, when the subclass' init method is defined, it is called.

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

Parameters:
Name Default Value Summary
name : string

The name of the created class.

instSpec : Object

The instance-side specification.

Parameters:
Name Default Value Summary
extend_order : Array.<string>
 
Optional

An array of instance property names that extend should always apply before other properties and in the given order.

The given property names are appended to any inherited ordered property names.

extend_exclude : Object
 
Optional

A set of property names to exclude, whenever the instance side of the class (through mix or implement) or its instances (through extend) are extended.

The given property names are joined with any inherited excluded property names.

Properties can have any value.

classSpec : Object

The class-side specification.

keyArgs : Object

The keyword arguments.

Returns:
Name Description
Class.<pentaho.lang.Base>

The new subclass.

_subclassed(Subclass, instSpec, classSpec, keyArgs)
 
Static
 
Protected

Called when a subclass of this class has been created.

The default implementation mixes the given instance and class specification in the new subclass.

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

Parameters:
Name Default Value Summary
Subclass : function

The created subclass.

instSpec : Object

The instance-side specification.

classSpec : Object

The static-side specification.

keyArgs : Object

The keyword arguments.

extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static

Creates a subclass of this one.

All classes inherit the extend method, so they can also be subclassed.

Inheritance is delegated to the _extend method, which can be overridden.

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

Parameters:
Name Default Value Summary
name : string
 
Optional

The name of the created class. Used for debugging purposes.

instSpec : Object
 
Optional

The instance specification.

Parameters:
Name Default Value Summary
extend_order : Array.<string>
 
Optional

An array of instance property names that extend should always apply before other properties and in the given order.

The given property names are appended to any inherited ordered property names.

extend_exclude : Object
 
Optional

A set of property names to exclude, whenever the instance side of the class (through mix or implement) or its instances (through extend) are extended.

The given property names are joined with any inherited excluded property names.

Properties can have any value.

classSpec : Object
 
Optional

The static specification.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
 
Optional

A set of property names to exclude, both from the instance and class sides, in this method call. Properties can have any value.

Returns:
Name Description
Class.<pentaho.lang.Base>

The new subclass.

implement(instSpecs) : !Class.<pentaho.lang.Base> | function
 
Static

Adds instance specifications to this class.

This method does not create a new class.

Each instance specification can be a class or an object. When it is a class, only its instance-side is mixed-in.

This method can be applied to other, non-Base classes (e.g. using Base.implement.call(Alien, instanceMix)).

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

Parameters:
Name Default Value Summary
instSpecs : function | Object

The instance-side specifications to mix-in.

Returns:
Name Description
!Class.<pentaho.lang.Base> | function

This class.

See also:  pentaho.lang.Base.implementStatic , pentaho.lang.Base.mix

implementStatic(classSpecs) : !Class.<pentaho.lang.Base> | function
 
Static

Adds static specifications to this class.

This method does not create a new class.

Each class-side/static specification can be a class or an object. When it is a class, only its class-side is mixed-in.

This method can be applied to other, non-Base classes (e.g. using Base.implementStatic.call(Alien, classMix)).

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

Parameters:
Name Default Value Summary
classSpecs : function | Object

The class-side specifications to mix-in.

Returns:
Name Description
!Class.<pentaho.lang.Base> | function

This class.

mix(instSpec, classSpec, keyArgs) : Class.<pentaho.lang.Base>
 
Static

Adds additional members to, or overrides existing ones of, this class.

This method does not create a new class.

This method supports two signatures:

  1. mix(Class: function[, keyArgs: Object]) - mixes-in the given class, both its instance and class sides.

  2. mix(instSpec: Object[, classSpec: Object[, keyArgs: Object]]) - mixes-in the given instance and class side specifications.

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

Parameters:
Name Default Value Summary
instSpec : function | Object

The class to mixin or the instance-side specification.

classSpec : Object
 
Optional

The class-side specification.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
 
Optional

A set of property names to exclude, both from the instance and class sides. Properties can have any value.

Returns:
Name Description
Class.<pentaho.lang.Base>

This class.

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 644

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

The value to be converted.

other : any
 
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.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

Methods that are overridden are accessible through this.base.

This object is extended, but its class doesn't change.

Can be applied to non-Base instances (e.g. using Base.prototype.extend.call(alien, {a: "hello"})).

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

Parameters:
Name Default Value Summary
source : Object

The instance specification.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
exclude : Object
 
Optional

A map of property names to exclude from source.

Returns:
Name Description
Object

This object.