Skip to main content
Pentaho Documentation

List

pentaho.type.List

The base class of plural values.

A list is an ordered set of elements of a common, base type.

AMD Module

require(["pentaho/type/list"], function(List) { /* code goes here */ });

See also:  pentaho.type.Element , pentaho.type.spec.IList , pentaho.type.spec.IListProto , pentaho.type.spec.IListTypeProto

Extends

Constructor

Name Description
new List(spec, keyArgs)

Creates a list instance.

Classes

Name Summary
Type

The base type class of plural value types.

Members

Name Description
$changeset : pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

$hasChanges : boolean

Gets a value that indicates if this instance has any changes in the ambient transaction.

$isBoundary : boolean

Gets a value that indicates if this list is a boundary list.

$isReadOnly : boolean

Gets a value that indicates if this list is read-only.

$isValid : boolean

Determines if this value is a valid instance of its type.

$key : string

Gets the key of the list value.

$references : Array.<Object>

Gets the references to this container, or null, if none.

$type : pentaho.type.Value.Type

Gets the type of this instance.

$uid : string

Gets the unique identifier of the instance.

$version : number

Gets the current version of the instance.

base : function
 
Protected

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

configure

Configures a list instance with a given configuration.

count : number

Gets the number of elements in the list.

Methods

Name Description
extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.type.List>
 
Static

Creates a subtype of this one.

_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

_createChangeset(transaction) : pentaho.type.changes.Changeset
 
Protected

Creates a changeset with this container as owner and returns it.

_emit(event) : pentaho.lang.Event
 
Protected

Emits an unstructured event and returns it, unless it was canceled.

_emitGeneric(event, type, phase, keyArgs) : object
 
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

_emitSafe(event) : pentaho.lang.Event
 
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

_hasListeners(type, phase) : boolean
 
Protected

Determines if there are any registrations for a given event type and phase.

_hasObservers(type) : boolean
 
Protected

Determines if there are any registrations for a given event type, for at least one of its phases.

_initClone(clone)
 
Protected

Initializes a shallow clone of this container.

_initContainer()
 
Protected

Initializes a container instance.

_onChangeDid(changeset)
 
Protected

Called after a changeset has been committed.

_onChangeRejected(changeset, reason)
 
Protected

Called after a changeset has been rejected.

_onChangeWill(changeset) : pentaho.lang.UserError | undefined
 
Protected

Called before a changeset is committed.

add(fragment)

Adds and/or updates one or more elements to the end of the list.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

at(index) : pentaho.type.Element

Gets the element at a specified index, or null.

clear()

Removes all elements from the list.

clone() : pentaho.type.Value
 
Abstract

Creates a shallow clone of this value.

each(fun, ctx)

Calls a function for each element of the list.

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

extend(source, keyArgs) : Object

Extend an object with the properties of another.

get(key) : pentaho.type.Element

Gets the element having a specified key value, if any, or null.

has(key) : boolean

Gets a value that indicates if an element with a given key is present in the list.

includes(elem) : boolean

Gets a value that indicates if a given element is present in the list.

indexOf(elem) : number

Gets the index of a given element in the list.

insert(fragment, index)

Inserts and/or updates one or more elements, starting at the given index.

move(elemSpec, indexNew)

Moves an element to a new position.

off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

remove(fragment)

Removes one or more elements from the list.

removeAt(start, count)

Removes one or more elements from the list, given the start index and the number of elements to remove.

set(fragment, keyArgs)

Adds, removes, moves and/or updates elements to the element list.

sort(comparer)

Sorts the elements of the list using the given comparer function.

toArray(map, ctx) : Array.<any>

Creates an array with the elements of the list or values derived from each element.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is a valid instance of its type.

Constructor Details

new List(spec, keyArgs)

Creates a list instance.

When a derived class overrides the constructor and creates additional instance properties, the pentaho.type.List#_initClone method should also be overridden to copy those properties.

Source: javascript/web/pentaho/type/list.js, line 74

Parameters:
Name Default Value Summary
spec : pentaho.type.spec.UList
 
Optional

The list specification or another compatible list instance.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
isBoundary : boolean
 
Optional
false

Indicates if the list should be a boundary list.

isReadOnly : boolean
 
Optional
false

Indicates if the list should be a read-only list.

See also:  pentaho.type.Element , pentaho.type.spec.IList , pentaho.type.spec.IListProto , pentaho.type.spec.IListTypeProto

Members Details

$changeset: pentaho.type.changes.Changeset

Gets the changeset of this instance in the ambient transaction, if any, or null.

Source: javascript/web/pentaho/type/mixins/Container.js, line 203

Inherited From: pentaho.type.mixins.Container#$changeset

$hasChanges: boolean

Gets a value that indicates if this instance has any changes in the ambient transaction.

Source: javascript/web/pentaho/type/mixins/Container.js, line 213

Inherited From: pentaho.type.mixins.Container#$hasChanges

$isBoundary: boolean

Gets a value that indicates if this list is a boundary list.

A boundary list isolates the list holder from the list's elements.

The validity of a boundary list is not affected by the validity of its elements. Changes within the elements of boundary list do not bubble to it.

Source: javascript/web/pentaho/type/list.js, line 163

$isReadOnly: boolean

Gets a value that indicates if this list is read-only.

Source: javascript/web/pentaho/type/list.js, line 133

$isValid: boolean

Determines if this value is a valid instance of its type.

This attribute calls validate and returns a boolean value indicating if it returned no errors.

Source: javascript/web/pentaho/type/value.js, line 123

Inherited From: pentaho.type.Value#$isValid

$key: string

Gets the key of the list value.

The key of a value identifies it among values of the same concrete type.

If two values have the same concrete type and their keys are equal, then it must also be the case that pentaho.type.Value.Type#areEqual returns true when given the two values. The opposite should be true as well. If two values of the same concrete type have distinct keys, then pentaho.type.Value.Type#areEqual should return false.

The default list implementation, returns the value of the list instance's pentaho.type.List#$uid.

Source: javascript/web/pentaho/type/list.js, line 271

Overrides: pentaho.type.Value#$key

$references: Array.<Object>

Gets the references to this container, or null, if none.

Note that the returned array may be empty.

Do NOT change the returned array or its elements in any way.

Source: javascript/web/pentaho/type/mixins/Container.js, line 145

Inherited From: pentaho.type.mixins.Container#$references

$type: pentaho.type.Value.Type

Gets the type of this instance.

Source: javascript/web/pentaho/type/value.js, line 246

Overrides: pentaho.type.Value#$type

$uid: string

Gets the unique identifier of the instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 129

Inherited From: pentaho.type.mixins.Container#$uid

$version: number

Gets the current version of the instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 177

Inherited From: pentaho.type.mixins.Container#$version

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 299

Inherited From: pentaho.lang.Base#base

configure:

Configures a list instance with a given configuration.

When config is another list, an error is thrown.

When config is a plain object, its keys are the keys of list elements, which must belong to the list, and the values are the configuration values, which are then passed to the element's configure method.

Source: javascript/web/pentaho/type/list.js, line 189

Overrides: pentaho.type.Value#configure

count: number

Gets the number of elements in the list.

Source: javascript/web/pentaho/type/list.js, line 281

Methods Details

extend(name, instSpec, classSpec, keyArgs) : Class.<pentaho.type.List>
 
Static

Creates a subtype of this one.

For more information on class extension, in general, see pentaho.lang.Base.extend.

Source: javascript/web/pentaho/type/list.js, line 765

Parameters:
Name Default Value Summary
name : string
 
Optional

The name of the created class, used for debugging purposes.

instSpec : pentaho.type.spec.IListProto
 
Optional

The instance specification.

classSpec : Object
 
Optional

The static specification.

keyArgs : Object
 
Optional

The keyword arguments.

Returns:
Name Description
Class.<pentaho.type.List>

The new list instance subclass.

See also:  pentaho.type.Value.extend

_configure(config)
 
Protected

Configures this value with a given non-nully configuration.

The default implementation does nothing.

Source: javascript/web/pentaho/type/value.js, line 178

Overrides: pentaho.type.Value#_configure

Parameters:
Name Default Value Summary
config : any

The configuration.

_createChangeset(transaction) : pentaho.type.changes.Changeset
 
Protected

Creates a changeset with this container as owner and returns it.

Source: javascript/web/pentaho/type/mixins/Container.js, line 238

Overrides: pentaho.type.mixins.Container#_createChangeset

Parameters:
Name Default Value Summary
transaction : pentaho.type.changes.Transaction

The transaction that owns this changeset.

Returns:
Name Description
pentaho.type.changes.Changeset

A changeset of the appropriate type.

_emit(event) : pentaho.lang.Event
 
Protected

Emits an unstructured event and returns it, unless it was canceled.

When this method is called, the listeners of existing registrations are notified synchronously, by priority order and then registration order, until either the event is canceled or all of the listeners have been notified.

It is safe to register or unregister to/from an event type while it is being emitted. However, changes are only taken into account in subsequent emissions.

If a listener function throws an error, the event processing is interrupted. No more registrations are processed and the error is passed to the caller.

Source: javascript/web/pentaho/lang/EventSource.js, line 261

Inherited From: pentaho.lang.EventSource#_emit

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also:  pentaho.lang.EventSource#_emitSafe , pentaho.lang.EventSource#_emitGeneric

_emitGeneric(event, type, phase, keyArgs) : object
 
Protected

Emits an event given an arbitrary payload object, its type and phase. Returns the event payload object, unless the event is canceled.

Source: javascript/web/pentaho/lang/EventSource.js, line 313

Inherited From: pentaho.lang.EventSource#_emitGeneric

Parameters:
Name Default Value Summary
event : object

The event object.

type : nonEmptyString

The type of the event.

phase : nonEmptyString
 
Optional

The phase of the event. For unstructured events don't specify this argument (or specify a Nully value).

keyArgs : Object
 
Optional

The keyword arguments' object.

Parameters:
Name Default Value Summary
isCanceled : function
 
Optional

A predicate that indicates if a given event object is in a canceled state.

errorHandler : function
 
Optional

When specified with a null value, no error handling is performed and errors thrown by listeners are thrown back to this method's caller. When unspecified or specified as undefined, defaults to a function that simply log the listener errors, and let execution continue to following listeners. The function arguments are: the error, the event, the event type and the event phase.

Returns:
Name Description
object | null

The event payload object or null, when the event is canceled.

_emitSafe(event) : pentaho.lang.Event
 
Protected

Variation of the _emit method in which errors thrown by event listeners are caught and logged.

If an event listener throws an error, the following event listeners are still processed.

Source: javascript/web/pentaho/lang/EventSource.js, line 283

Inherited From: pentaho.lang.EventSource#_emitSafe

Parameters:
Name Default Value Summary
event : pentaho.lang.Event

The event object.

Returns:
Name Description
pentaho.lang.Event | null

The given event object or null, when canceled.

See also:  pentaho.lang.EventSource#_emit , pentaho.lang.EventSource#_emitGeneric

_hasListeners(type, phase) : boolean
 
Protected

Determines if there are any registrations for a given event type and phase.

This method can be used to avoid creating expensive event objects for event type and phase pairs that don't have registrations.

Source: javascript/web/pentaho/lang/EventSource.js, line 189

Inherited From: pentaho.lang.EventSource#_hasListeners

Parameters:
Name Default Value Summary
type : nonEmptyString

The type of the event.

phase : nonEmptyString
 
Optional

The phase of a structured event. For unstructured events don't specify this argument.

Returns:
Name Description
boolean

true if the event has any listeners for the given event type and phase; false, otherwise.

Example

if(this._hasListeners("select", "will")) {

 var event = new Event("select", this);

 if(this._emit(event)) {
 // Select Will phase
 }
}
_hasObservers(type) : boolean
 
Protected

Determines if there are any registrations for a given event type, for at least one of its phases.

This method can be used to avoid creating expensive event objects for event types that currently have no registrations.

Source: javascript/web/pentaho/lang/EventSource.js, line 232

Inherited From: pentaho.lang.EventSource#_hasObservers

Parameters:
Name Default Value Summary
type : nonEmptyString

The type of the event.

Returns:
Name Description
boolean

true if the event has any observers for the given event type; false, otherwise.

Example

if(this._hasObservers("select")) {

 var event = new Event("select");

 if(this._emitGeneric(event, "select", "will")) {
 // Select Will

 this._emitGeneric(event, "select", "did");
 }
}
_initClone(clone)
 
Protected

Initializes a shallow clone of this container.

The default implementation calls pentaho.type.mixins.Container#_initContainer.

Source: javascript/web/pentaho/type/mixins/Container.js, line 119

Overrides: pentaho.type.mixins.Container#_initClone

Parameters:
Name Default Value Summary
clone : pentaho.type.mixins.Container

The cloned container to initialize.

_initContainer()
 
Protected

Initializes a container instance.

Source: javascript/web/pentaho/type/mixins/Container.js, line 53

Inherited From: pentaho.type.mixins.Container#_initContainer

_onChangeDid(changeset)
 
Protected

Called after a changeset has been committed.

The default implementation emits the "did:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 290

Inherited From: pentaho.type.mixins.Container#_onChangeDid

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

_onChangeRejected(changeset, reason)
 
Protected

Called after a changeset has been rejected.

The default implementation emits the "rejected:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 311

Inherited From: pentaho.type.mixins.Container#_onChangeRejected

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

reason : Error

The reason why the changes were rejected.

_onChangeWill(changeset) : pentaho.lang.UserError | undefined
 
Protected

Called before a changeset is committed.

The default implementation emits the "will:change" event for the given changeset, if there are any listeners.

When overriding, be sure to call the base implementation.

Source: javascript/web/pentaho/type/mixins/Container.js, line 269

Inherited From: pentaho.type.mixins.Container#_onChangeWill

Parameters:
Name Default Value Summary
changeset : pentaho.type.changes.Changeset

The set of changes.

Returns:
Name Description
pentaho.lang.UserError | undefined

An error if the changeset was canceled; or, undefined otherwise.

add(fragment)

Adds and/or updates one or more elements to the end of the list.

The element or elements specified in argument fragment are converted to the list's element class.

Source: javascript/web/pentaho/type/list.js, line 387

Parameters:
Name Default Value Summary
fragment : any | Array

Value or values to add.

Throws:
Name Description
TypeError

When the list is read-only.

assertValid()

Ensures that the value is valid, and throws the first validation error if it is not.

This method calls the validate method.

Source: javascript/web/pentaho/type/value.js, line 152

Inherited From: pentaho.type.Value#assertValid

Throws:
Name Description
pentaho.type.ValidationError

When the value is not valid, the first error returned by the validate method.

at(index) : pentaho.type.Element

Gets the element at a specified index, or null.

Source: javascript/web/pentaho/type/list.js, line 291

Parameters:
Name Default Value Summary
index : number

The desired index.

Returns:
Name Description
pentaho.type.Element

The element value or null.

clear()

Removes all elements from the list.

Source: javascript/web/pentaho/type/list.js, line 490

Throws:
Name Description
TypeError

When the list is read-only.

clone() : pentaho.type.Value
 
Abstract

Creates a shallow clone of this value.

Source: javascript/web/pentaho/type/value.js, line 86

Overrides: pentaho.type.mixins.Container#clone

Returns:
Name Description
pentaho.type.Value

The value clone.

each(fun, ctx)

Calls a function for each element of the list.

Source: javascript/web/pentaho/type/list.js, line 520

Parameters:
Name Default Value Summary
fun : function

The mapping function. Return false to break iteration.

ctx : Object
 
Optional

The JS context object on which fun is called.

equals(other) : boolean

Determines if a given value, of the same type, represents the same entity.

The default implementation delegates the operation to the _isEqual method.

Source: javascript/web/pentaho/type/value.js, line 107

Inherited From: pentaho.type.Value#equals

Parameters:
Name Default Value Summary
other : any

A value to test for equality.

Returns:
Name Description
boolean

true if the given value is equal to this one; or, false, otherwise.

See also:  pentaho.type.Value#$key , pentaho.type.Value.Type#areEqual

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.

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

Inherited From: pentaho.lang.Base#extend

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.

get(key) : pentaho.type.Element

Gets the element having a specified key value, if any, or null.

Source: javascript/web/pentaho/type/list.js, line 338

Parameters:
Name Default Value Summary
key : string | any

The element's key.

Returns:
Name Description
pentaho.type.Element

The corresponding element or null.

has(key) : boolean

Gets a value that indicates if an element with a given key is present in the list.

Source: javascript/web/pentaho/type/list.js, line 303

Parameters:
Name Default Value Summary
key : string | any

The element's key.

Returns:
Name Description
boolean

true if an element with the given key is present in the list; false, otherwise.

includes(elem) : boolean

Gets a value that indicates if a given element is present in the list.

Source: javascript/web/pentaho/type/list.js, line 316

Parameters:
Name Default Value Summary
elem : pentaho.type.Element

The element to test.

Returns:
Name Description
boolean

true if the element is present in the list; false, otherwise.

indexOf(elem) : number

Gets the index of a given element in the list.

Source: javascript/web/pentaho/type/list.js, line 327

Parameters:
Name Default Value Summary
elem : pentaho.type.Element

The element whose index to determine.

Returns:
Name Description
number

true if the element is present in the list; false, otherwise.

insert(fragment, index)

Inserts and/or updates one or more elements, starting at the given index.

If index is negative, it means the position at that many elements from the end (index' = count - index).

When the index is greater than or equal to the length of the list, the element or elements are appended to the list.

Source: javascript/web/pentaho/type/list.js, line 405

Parameters:
Name Default Value Summary
fragment : any | Array

Element or elements to add.

index : number

The index at which to start inserting new elements.

Throws:
Name Description
TypeError

When the list is read-only.

move(elemSpec, indexNew)

Moves an element to a new position.

Source: javascript/web/pentaho/type/list.js, line 436

Parameters:
Name Default Value Summary
elemSpec : any

An element specification.

indexNew : number

The new index of the element.

Throws:
Name Description
TypeError

When the list is read-only.

Implements:
off(typeOrHandle, observer)

Removes one registration given its handle, or all registrations of a given event type (or types) and observer (or listener function).

To remove an event registration, it is sufficient to call the dispose method of the registration handle returned by on, upon registration. Alternatively, as a convenience syntax, the registration handle can be passed as the single argument to this method.

It is safe to unregister from an event type while it is being emitted. However, any registrations removed during the current emission will still execute.

Specifying an event registration handle that has already been disposed of has no effect. Specifying an event type and observer (or listener function) that have no registrations has no effect.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 131

Inherited From: pentaho.lang.EventSource#off

Parameters:
Name Default Value Summary
typeOrHandle : nonEmptyString | Array.<nonEmptyString> | pentaho.lang.IEventRegistrationHandle

The type or types of events, or an event registration handle to dispose of. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function). Required when typeOrHandle is not an event registration handle; ignored, otherwise.

See also:  pentaho.lang.IEventSource#on

Implements:
on(type, observer, keyArgs) : pentaho.lang.IEventRegistrationHandle

Registers an observer (or listener function) for an event(s) of a given type(s).

Optionally, a listening priority may be specified to adjust the order by which an observer is notified, relative to other listeners.

Note that if an observer is registered more than once to the same event type, a new registration is created each time and its listeners will be called once per registration.

It is safe to register for an event type while it is being emitted. However, new registrations are only taken into account in subsequent emissions.

When type represents multiple event types, the returned event registration handle is a composite registration for all of the event types.

This method is compatible with the dojo/on API.

Source: doc-js/pentaho/lang/IEventSource.jsdoc, line 90

Inherited From: pentaho.lang.EventSource#on

Parameters:
Name Default Value Summary
type : nonEmptyString | Array.<nonEmptyString>

The type or types of events. When a string, it can be a comma-separated list of event types.

observer : pentaho.lang.IEventObserver | pentaho.lang.EventListener | pentaho.lang.EventListenerAsync

The event observer (or listener function).

keyArgs : object
 
Optional

Keyword arguments.

Parameters:
Name Default Value Summary
priority : number
 
Optional
0

The listening priority. Higher priority observers are notified of an event before any lower priority observers. The priority can be set to -Infinity or Infinity. In case two observers are assigned the same priority, the registration order determines which is notified first.

Returns:
Name Description
pentaho.lang.IEventRegistrationHandle

An event registration handle that can be used for later removal.

See also:  pentaho.lang.IEventSource#off

remove(fragment)

Removes one or more elements from the list.

Specified elements that are not present in the list are ignored.

Source: javascript/web/pentaho/type/list.js, line 419

Parameters:
Name Default Value Summary
fragment : any | Array

Element or elements to remove.

Throws:
Name Description
TypeError

When the list is read-only.

removeAt(start, count)

Removes one or more elements from the list, given the start index and the number of elements to remove.

If count is Nully or omitted, it defaults to 1. If count is less than 1, nothing is removed. If start is not less than the number of elements in the list, nothing is removed. If start is negative, it means to start removing that many elements from the end (start' = length - start).

Source: javascript/web/pentaho/type/list.js, line 460

Parameters:
Name Default Value Summary
start : number

The index at which to start removing.

count : number
 
Optional
1

The number of elements to remove.

Throws:
Name Description
TypeError

When the list is read-only.

set(fragment, keyArgs)

Adds, removes, moves and/or updates elements to the element list.

The element or elements specified in argument fragment are converted to the list's element class.

Source: javascript/web/pentaho/type/list.js, line 366

Parameters:
Name Default Value Summary
fragment : any | Array

The element or elements to set.

keyArgs : Object
 
Optional

The keyword arguments.

Parameters:
Name Default Value Summary
noAdd : boolean
 
Optional
false

Prevents adding new elements to the list.

noRemove : boolean
 
Optional
false

Prevents removing elements not present in fragment from the list.

noMove : boolean
 
Optional
false

Prevents moving elements inside the list.

noUpdate : boolean
 
Optional
false

Prevents updating elements already present in the list.

index : number
 
Optional

The index at which to add new elements. When unspecified, new elements are appended to the list. This argument is ignored when noAdd is true.

Throws:
Name Description
TypeError

When the list is read-only.

sort(comparer)

Sorts the elements of the list using the given comparer function.

Source: javascript/web/pentaho/type/list.js, line 476

Parameters:
Name Default Value Summary
comparer : function

The comparer function.

Throws:
Name Description
TypeError

When the list is read-only.

toArray(map, ctx) : Array.<any>

Creates an array with the elements of the list or values derived from each element.

Source: javascript/web/pentaho/type/list.js, line 507

Parameters:
Name Default Value Summary
map : function
 
Optional

A function that converts each element into something else.

ctx : Object
 
Optional

The JS context object on which to call map.

Returns:
Name Description
Array.<any>

An array of elements.

toJSON() : UJsonValue

Creates a top-level JSON specification that describes this instance.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, for inline types, attributes with a function value are not supported.

This method simply calls pentaho.type.Instance#toSpec with argument keyArgs.isJson as true and exists for seamless integration with JavaScript's JSON.stringify method.

Source: javascript/web/pentaho/type/instance.js, line 210

Inherited From: pentaho.type.Instance#toJSON

Returns:
Name Description
UJsonValue

A JSON-compatible specification.

See also:  pentaho.type.Instance#toSpec

Implements:
toSpec(keyArgs) : pentaho.type.spec.UInstance

Creates a specification that describes this value.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current. Then, the actual work is delegated to pentaho.type.Instance#toSpecInContext.

Source: javascript/web/pentaho/type/value.js, line 184

Inherited From: pentaho.type.Value#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments object. Passed to every value and type serialized within this scope.

Please see the documentation of value subclasses for information on additional, supported keyword arguments.

Parameters:
Name Default Value Summary
isJson : boolean
 
Optional
false

Generates a JSON-compatible specification. Attributes which do not have a JSON-compatible specification are omitted.

declaredType : pentaho.type.Type
 
Optional

The base type of this value's storage location. If the value does not have this exact type, its inline type property must be included in the specification. Otherwise, it can be omitted. When unspecified, the inline type property is only included if forceType is true.

forceType : boolean
 
Optional
false

Forces inclusion of the inline type property, _, in the specification.

omitFormatted : boolean
 
Optional
false

Omits the formatted value on Simple values' specifications.

preferPropertyArray : boolean
 
Optional
false

Indicates that, if possible, array form is used for Complex values' specifications.

The array form of a complex value cannot be used when its type must be inlined.

includeDefaults : boolean
 
Optional
false

When true, all of the properties of Complex values are serialized. When false, the default, only properties whose value is different from their default value are serialized.

Only applies to complex values that are serialized in object form. In array form, all of the properties of complex values are serialized independently of their value.

omitProps : Object
 
Optional

An object whose own property names with a truthy value are the names of the properties of the current complex type to omit from the serialization.

Only applies when a complex is output in object form. In array form, all properties are output whatever their value.

This argument only applies to complex values and is not passed through to the values of their properties.

Returns:
Name Description
pentaho.type.spec.UInstance

A specification of this value.

toSpecInContext(keyArgs) : any

Creates a specification that describes this instance.

Source: javascript/web/pentaho/type/instance.js, line 190

Overrides: pentaho.type.Value#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

The keyword arguments' object. Passed to every instance and type serialized within this scope.

Please see the documentation of subclasses for information on additional, supported keyword arguments.

Returns:
Name Description
any

A specification of this instance.

See also:  pentaho.type.Instance#toSpec

validate() : Array.<pentaho.type.ValidationError>

Determines if this value is a valid instance of its type.

The default implementation delegates to pentaho.type.Value.Type#_validate.

Source: javascript/web/pentaho/type/value.js, line 137

Inherited From: pentaho.type.Value#validate

Returns:
Name Description
Array.<pentaho.type.ValidationError>

A non-empty array of errors or null.

See also:  pentaho.type.Value#$isValid