Skip to main content
Pentaho Documentation

Tree

pentaho.data.filter.Tree

The base class of filters that combine other filters.

Example subclasses include:

AMD Module

require(["pentaho/data/filter/tree"], function(Tree) { /* code goes here */ });

Extends

Constructor

Name Description
new Tree(spec)
 
Abstract

Creates a filter that combines a series of filters.

Classes

Name Summary
Type

The base type class of Tree filter 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.

$isValid : boolean

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

$key : string

Gets the key of the complex 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.

__compiled : function

The compiled predicate function. Lazily created.

_inverseClass : Class.<pentaho.data.filter.Tree>
 
Abstract
 
Protected

Gets the inverse filter class.

base : function
 
Protected

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

contentKey : string

Gets a key that identifies the content of this filter.

isNot : boolean

Gets a value that indicates if this filter is a Not filter.

isProperty : boolean

Gets a value that indicates if this filter is a Property filter.

isTerminal : boolean

Gets a value that indicates if this filter is terminal.

kind : string

Gets the kind of this filter.

operands : pentaho.type.List.<pentaho.data.filter.Abstract>

Gets the list of operands of this filter.

Methods

Name Description
_buildContentKey() : string
 
Protected

Builds the content key.

_compile() : function
 
Abstract
 
Protected

Compiles a predicate function that tests if the filter contains a given element.

_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.

_initProperties(spec)
 
Protected

Initializes the properties of the complex instance from a the given specification.

_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.

_operation(operands) : pentaho.filter.Abstract
 
Protected

Performs the boolean operation including its operands and the additional operands provided as arguments.

_visitDefault(transformer) : pentaho.data.filter.Abstract
 
Protected

Creates a filter that is a transformed version of this filter, the default way.

and(filters) : pentaho.data.filter.Abstract

Creates a filter that is the conjunction (intersection) between this filter and a variable number of other filters.

andNot(exclude) : pentaho.data.filter.Abstract

Creates a filter that is the "difference" between this filter and a variable number of other filters.

assertValid()

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

clone() : pentaho.type.Value
 
Abstract

Creates a shallow clone of this value.

compile() : function

Compiles a predicate function that tests if the filter contains a given element.

configure(config) : pentaho.type.Value

Configures this value with a given configuration.

contains(elem) : boolean

Determines if an element is selected by this filter.

countOf(name, sloppy) : number

Gets the number of values of a given property.

countRangeOf(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

domainOf(name) : Array.<pentaho.type.Element>

Gets the current list of valid values of a given property.

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(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

getf(name, sloppy) : string

Gets the string representation of the value of a property.

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

isApplicableOf(name) : boolean

Gets a value that indicates if a given property is currently applicable.

isDefaultedOf(name) : boolean

Gets a value that indicates if a given property has assumed a default value.

isEnabledOf(name) : boolean

Gets a value that indicates if a given property is currently enabled.

isRequiredOf(name) : boolean

Gets a value that indicates if a given property is currently required.

negate() : pentaho.data.filter.Abstract

Creates a filter that is the negation of this filter.

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).

or(filters) : pentaho.data.filter.Abstract

Creates a filter that is the disjunction (union) between this filter and a variable number of other filters.

set(name, valueSpec)

Sets the value of a property.

toDnf() : pentaho.data.filter.True | pentaho.data.filter.False | pentaho.data.filter.Or

Converts a copy of this filter into Disjunctive Normal Form and returns it.

toExtensional(dataTable, keyColumnNames) : pentaho.data.filter.Or | pentaho.data.filter.False

Gets the extensional representation of a Filter by specifying the clauses that select data by inclusion. If the resulting filtered data of a filter is empty then the false filter is returned

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.

visit(transformer) : pentaho.data.filter.Abstract

Creates a filter that is a transformed version of this filter.

visitOperands(transformer, keyArgs) : Array.<pentaho.data.filter.Abstract>

Creates transformed versions of the operands of this filter.

Constructor Details

new Tree(spec)
 
Abstract

Creates a filter that combines a series of filters.

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 34

Parameters:
Name Default Value Summary
spec : pentaho.data.filter.spec.ITree
 
Optional

A tree filter specification.

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

$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 complex 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 complex implementation returns the value of the $uid property.

Source: javascript/web/pentaho/type/complex.js, line 195

Inherited From: pentaho.type.Complex#$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.data.filter.Abstract#$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

__compiled: function

The compiled predicate function. Lazily created.

Source: javascript/web/pentaho/data/filter/abstract.js, line 184

Inherited From: pentaho.data.filter.Abstract#__compiled

_inverseClass: Class.<pentaho.data.filter.Tree>
 
Abstract
 
Protected

Gets the inverse filter class.

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 81

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

contentKey: string

Gets a key that identifies the content of this filter.

Source: javascript/web/pentaho/data/filter/abstract.js, line 132

Inherited From: pentaho.data.filter.Abstract#contentKey

isNot: boolean

Gets a value that indicates if this filter is a Not filter.

Source: javascript/web/pentaho/data/filter/abstract.js, line 111

Inherited From: pentaho.data.filter.Abstract#isNot

isProperty: boolean

Gets a value that indicates if this filter is a Property filter.

Source: javascript/web/pentaho/data/filter/abstract.js, line 121

Inherited From: pentaho.data.filter.Abstract#isProperty

isTerminal: boolean

Gets a value that indicates if this filter is terminal.

The non-terminal filter types are Or, And, and Not.

Source: javascript/web/pentaho/data/filter/abstract.js, line 101

Overrides: pentaho.data.filter.Abstract#isTerminal

kind: string

Gets the kind of this filter.

The values of the standard, concrete filter kinds are available in the KnownFilterKind enumeration.

Source: javascript/web/pentaho/data/filter/abstract.js, line 77

Inherited From: pentaho.data.filter.Abstract#kind

operands: pentaho.type.List.<pentaho.data.filter.Abstract>

Gets the list of operands of this filter.

This getter is a shorthand for this.get("operands").

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 77

Methods Details

_buildContentKey() : string
 
Protected

Builds the content key.

The return value is automatically augmented with the kind of filter information.

Source: javascript/web/pentaho/data/filter/abstract.js, line 147

Overrides: pentaho.data.filter.Abstract#_buildContentKey

Returns:
Name Description
string

The content key.

_compile() : function
 
Abstract
 
Protected

Compiles a predicate function that tests if the filter contains a given element.

This method can assume that the filter is valid.

Source: javascript/web/pentaho/data/filter/abstract.js, line 214

Inherited From: pentaho.data.filter.Abstract#_compile

Returns:
Name Description
function

The predicate function.

_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

Inherited From: 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

Inherited From: 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

Inherited From: 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

_initProperties(spec)
 
Protected

Initializes the properties of the complex instance from a the given specification.

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

Inherited From: pentaho.type.Complex#_initProperties

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

A complex specification.

_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.

_operation(operands) : pentaho.filter.Abstract
 
Protected

Performs the boolean operation including its operands and the additional operands provided as arguments.

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 110

Parameters:
Name Default Value Summary
operands : any
 
Repeatable

The additional operands.

Returns:
Name Description
pentaho.filter.Abstract

The resulting filter.

_visitDefault(transformer) : pentaho.data.filter.Abstract
 
Protected

Creates a filter that is a transformed version of this filter, the default way.

This implementation visits existing operands and, if none are modified, this is returned. Otherwise, a new filter of the same type and with the transformed operands is returned.

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 163

Overrides: pentaho.data.filter.Abstract#_visitDefault

Parameters:
Name Default Value Summary
transformer : pentaho.data.filter.FTransformer

The transformer function.

Returns:
Name Description
pentaho.data.filter.Abstract

The transformed filter.

See also:  pentaho.data.filter.Tree#visitOperands

and(filters) : pentaho.data.filter.Abstract

Creates a filter that is the conjunction (intersection) between this filter and a variable number of other filters.

Source: javascript/web/pentaho/data/filter/abstract.js, line 299

Inherited From: pentaho.data.filter.Abstract#and

Parameters:
Name Default Value Summary
filters : Array.<pentaho.data.filter.Abstract>
 
Repeatable

The filters to be intersected with this one.

Returns:
Name Description
pentaho.data.filter.Abstract

The resulting filter.

andNot(exclude) : pentaho.data.filter.Abstract

Creates a filter that is the "difference" between this filter and a variable number of other filters.

This operation is implemented in such a way as to not cause the term explosion that is likely to occur when trying to convert the result with a naive implementation to DNF:

var result = this.and(filter.negate());

var willIEverGetAResult = result.toDnf();

This implementation works first by converting both this filter and the exclude argument to DNF, assuming that these can be so converted in a reasonable time. Then, the difference is performed using an efficient algorithm.

Source: javascript/web/pentaho/data/filter/abstract.js, line 330

Inherited From: pentaho.data.filter.Abstract#andNot

Parameters:
Name Default Value Summary
exclude : pentaho.data.filter.Abstract

The filter to be "subtracted" from this one.

Returns:
Name Description
pentaho.data.filter.Abstract

The resulting filter (not necessarily in DNF form).

See also:  pentaho.data.filter.Abstract#toDnf

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.

clone() : pentaho.type.Value
 
Abstract

Creates a shallow clone of this value.

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

Inherited From: pentaho.type.Value#clone

Returns:
Name Description
pentaho.type.Value

The value clone.

compile() : function

Compiles a predicate function that tests if the filter contains a given element.

When the filter is not valid, an error is thrown. Otherwise, this method delegates to the _compile method.

The result of this method is cached.

Source: javascript/web/pentaho/data/filter/abstract.js, line 201

Inherited From: pentaho.data.filter.Abstract#compile

Returns:
Name Description
function

The predicate function.

Throws:
Name Description
pentaho.type.ValidationError

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

Implements:
configure(config) : pentaho.type.Value

Configures this value with a given configuration.

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

Inherited From: pentaho.type.Value#configure

Parameters:
Name Default Value Summary
config : any

The configuration.

Returns:
Name Description
pentaho.type.Value

This instance.

contains(elem) : boolean

Determines if an element is selected by this filter.

This method applies the predicate function returned by pentaho.data.filter.Abstract#compile to the given element.

Source: javascript/web/pentaho/data/filter/abstract.js, line 175

Inherited From: pentaho.data.filter.Abstract#contains

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

The candidate dataset element.

Returns:
Name Description
boolean

true if this filter contains element, or false otherwise.

Throws:
Name Description
pentaho.type.ValidationError

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

countOf(name, sloppy) : number

Gets the number of values of a given property.

When the specified property is a list property, its count is returned.

When the specified property is not a list property, 0 is returned if it is null; 1, otherwise.

Source: javascript/web/pentaho/type/complex.js, line 383

Inherited From: pentaho.type.Complex#countOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
number

The number of values.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

countRangeOf(name) : pentaho.IRange

Gets the current valid count range of values of a given property.

Source: javascript/web/pentaho/type/complex.js, line 433

Inherited From: pentaho.type.Complex#countRangeOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
pentaho.IRange

The range of the property.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

domainOf(name) : Array.<pentaho.type.Element>

Gets the current list of valid values of a given property.

Source: javascript/web/pentaho/type/complex.js, line 466

Inherited From: pentaho.type.Complex#domainOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

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

An array of elements if the property is constrained; null otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

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(name, sloppy) : pentaho.type.Value | Nully

Gets the value of a property.

If the specified property is not defined and sloppy is true, undefined is returned.

A list property always has a non-null value, possibly an empty list, but never null. An element property can have a null value.

Source: javascript/web/pentaho/type/complex.js, line 219

Inherited From: pentaho.type.Complex#get

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
pentaho.type.Value | Nully

The value of the property, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#getv , pentaho.type.Complex#getf

getf(name, sloppy) : string

Gets the string representation of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter returns a Nully value, "" is returned. Otherwise, the result of the value's toString() method is returned.

For a Simple type, this corresponds to returning its formatted attribute, when it is not null. For Complex and List types, varies with the implementation.

Source: javascript/web/pentaho/type/complex.js, line 310

Inherited From: pentaho.type.Complex#getf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
string

The string representation of the value, or "".

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#get , pentaho.type.Complex#getv

getv(name, sloppy) : any | pentaho.type.Complex | pentaho.type.List | Nully

Gets the primitive value of the value of a property.

This method reads the value of the property by calling Complex#get.

When the latter does not return a Nully value, the result of the value's valueOf() method is returned.

For a Simple type, this corresponds to returning its value attribute. For Complex and List types, this corresponds to the value itself.

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

Inherited From: pentaho.type.Complex#getv

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified property is not defined.

Returns:
Name Description
any | pentaho.type.Complex | pentaho.type.List | Nully

The primitive value of a Simple, the Complex or List value itself, or a Nully value.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When sloppy is false and a property with name name is not defined.

See also:  pentaho.type.Complex#get , pentaho.type.Complex#getf

isApplicableOf(name) : boolean

Gets a value that indicates if a given property is currently applicable.

Source: javascript/web/pentaho/type/complex.js, line 403

Inherited From: pentaho.type.Complex#isApplicableOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or type object.

Returns:
Name Description
boolean

true if the property is applicable; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isDefaultedOf(name) : boolean

Gets a value that indicates if a given property has assumed a default value.

Source: javascript/web/pentaho/type/complex.js, line 230

Inherited From: pentaho.type.Complex#isDefaultedOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

Returns:
Name Description
boolean

Returns true if the property has been defaulted; false, otherwise.

isEnabledOf(name) : boolean

Gets a value that indicates if a given property is currently enabled.

Source: javascript/web/pentaho/type/complex.js, line 418

Inherited From: pentaho.type.Complex#isEnabledOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type

The property name or property type object.

Returns:
Name Description
boolean

Returns true if the property is enabled; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

isRequiredOf(name) : boolean

Gets a value that indicates if a given property is currently required.

A property is currently required if its current pentaho.type.Complex#countRangeOf minimum is at least 1.

Source: javascript/web/pentaho/type/complex.js, line 451

Inherited From: pentaho.type.Complex#isRequiredOf

Parameters:
Name Default Value Summary
name : string | pentaho.type.Property.Type
 
Optional

The property name or type object.

Returns:
Name Description
boolean

true if the property is required; false, otherwise.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

negate() : pentaho.data.filter.Abstract

Creates a filter that is the negation of this filter.

Source: javascript/web/pentaho/data/filter/abstract.js, line 271

Overrides: pentaho.data.filter.Abstract#negate

Returns:
Name Description
pentaho.data.filter.Abstract

A negated filter.

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

or(filters) : pentaho.data.filter.Abstract

Creates a filter that is the disjunction (union) between this filter and a variable number of other filters.

Source: javascript/web/pentaho/data/filter/abstract.js, line 282

Inherited From: pentaho.data.filter.Abstract#or

Parameters:
Name Default Value Summary
filters : Array.<pentaho.data.filter.Abstract>
 
Repeatable

The filters to be joined with this one.

Returns:
Name Description
pentaho.data.filter.Abstract

The resulting filter.

set(name, valueSpec)

Sets the value of a property.

Source: javascript/web/pentaho/type/complex.js, line 328

Inherited From: pentaho.type.Complex#set

Parameters:
Name Default Value Summary
name : nonEmptyString | pentaho.type.Property.Type

The property name or type object.

valueSpec : any
 
Optional
null

A value specification.

Fires: event:will:change , event:did:change , event:rejected:change

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When a property with name name is not defined.

TypeError

When property is read-only.

toDnf() : pentaho.data.filter.True | pentaho.data.filter.False | pentaho.data.filter.Or

Converts a copy of this filter into Disjunctive Normal Form and returns it.

A filter in DNF is one of:

  1. A True filter - filters everything.
  2. A False filter - filters nothing.
  3. An Or of Ands of, possibly negated, (non-degenerate) terminal filters, such as: IsEqual.

DNF is particularly useful for representing filters because, excluding its degenerate cases, it is the natural form of a filter that selects a set of rows, such as:

(country = "us" and productLine = "cars") or (country = "pt" and productLine = "jets")

Generally, DNF conversion is computationally expensive, and, for some types of filters, can not terminate in a reasonable amount of time. One such type of filter is that which results from a difference operation, such as filterA.and(filterB.negate()). Directly converting such a structured filter to DNF will usually not terminate soon enough. For such a reason, and because it is such a common operation, the Filter API provides an optimized difference operator: andNot which is able to keep computational cost low enough for practical cases, . The resulting filter can safely be converted to DNF.

The result of this operation is cached.

Source: javascript/web/pentaho/data/filter/abstract.js, line 446

Inherited From: pentaho.data.filter.Abstract#toDnf

Returns:
Name Description
pentaho.data.filter.True | pentaho.data.filter.False | pentaho.data.filter.Or

The resulting DNF filter.

See also:  https://en.wikipedia.org/wiki/Disjunctive_normal_form

toExtensional(dataTable, keyColumnNames) : pentaho.data.filter.Or | pentaho.data.filter.False

Gets the extensional representation of a Filter by specifying the clauses that select data by inclusion. If the resulting filtered data of a filter is empty then the false filter is returned

Source: javascript/web/pentaho/data/filter/abstract.js, line 476

Inherited From: pentaho.data.filter.Abstract#toExtensional

Parameters:
Name Default Value Summary
dataTable : pentaho.data.ITable

The data to be used when determining the values of the key columns used in the extensional representation of the filter.

keyColumnNames : Array.<string>

The names of the columns from the {@code dataTable} that are considered key.

Returns:
Name Description
pentaho.data.filter.Or | pentaho.data.filter.False

The extensional filter.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

When the resulting filtered data is not empty and keyColumnNames is empty.

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

Inherited From: pentaho.type.Instance#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

visit(transformer) : pentaho.data.filter.Abstract

Creates a filter that is a transformed version of this filter.

This implementation calls transformer with this. If the result is non-Nully, it is returned. Otherwise, the result of calling _visitDefault is returned.

Source: javascript/web/pentaho/data/filter/abstract.js, line 241

Inherited From: pentaho.data.filter.Abstract#visit

Parameters:
Name Default Value Summary
transformer : pentaho.data.filter.FTransformer

The transformer function.

Returns:
Name Description
pentaho.data.filter.Abstract

The transformed filter.

visitOperands(transformer, keyArgs) : Array.<pentaho.data.filter.Abstract>

Creates transformed versions of the operands of this filter.

If no operands are actually modified, null is returned.

Source: javascript/web/pentaho/data/filter/_core/tree.js, line 181

Parameters:
Name Default Value Summary
transformer : pentaho.data.filter.FTransformer

The transformer function.

keyArgs : Object
 
Optional

The keyword arguments object.

Parameters:
Name Default Value Summary
where : function
 
Optional

A predicate function to filter desired children.

Returns:
Name Description
Array.<pentaho.data.filter.Abstract>

The transformed operands or null.

See also:  pentaho.data.filter.Tree#visit