Skip to main content
Pentaho Documentation

Type

pentaho.data.filter.IsLessOrEqual.Type

The type class of the less or equal than filter type.

For more information see pentaho.data.filter.IsLessOrEqual.

Extends

Constructor

Name Description
new Type()
 
Static

Members

Name Description
_isLabelSet : boolean
 
Protected

Gets a value that indicates if the label is locally set.

alias : __nonEmptyString

Gets the alias for the identifier of this type.

ancestor : pentaho.type.Type

Gets the parent type in the current type hierarchy, if any, or null.

application : object

Gets or sets the application attribute of this type.

category : __nonEmptyString

Gets or sets the category associated with this type.

context : pentaho.type.Context

Gets the context that defined this type class.

count

Gets the number of properties of the complex type.

defaultView : string

Gets or sets the default view for instances of this type.

defaultViewAbs : string

Gets the absolute view module identifier, if any.

description : __nonEmptyString

Gets or sets the description of this type.

hasDescendants : boolean

Gets a value that indicates if this type has any descendant types.

helpUrl : __nonEmptyString

Gets or sets a URL pointing to documentation associated with this type.

id : __nonEmptyString

Gets the identifier of this type.

inheritedStyleClasses : Array.<string>

Gets the style classes of this and any base types.

instance : pentaho.type.Instance

Gets the prototype of the instances of this type.

isAbstract : boolean

Gets a value that indicates if this type is abstract.

isAdvanced : boolean

Gets or sets the isAdvanced attribute of this type.

isBrowsable : boolean

Gets or sets the isBrowsable attribute of this type.

isComplex : boolean

Gets a value that indicates if this type is a complex type.

isContainer : boolean

Gets a value that indicates if this type is a list or a complex type.

isElement : boolean

Gets a value that indicates if this type is an element type.

isList : boolean

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

isProperty : boolean

Gets a value that indicates if this type is a property type.

isRoot : boolean

Gets a value that indicates if this type is the root of its type hierarchy.

isSimple : boolean

Gets a value that indicates if this type is a simple type.

isValue : boolean

Gets a value that indicates if this type is a value type.

label : __nonEmptyString

Gets or sets the label of this type.

mixins : Array.<pentaho.type.Type>

Gets or sets the mixin types that are locally mixed into this type.

ordinal : number

Gets or sets the ordinal associated with this type.

root : pentaho.type.Type

Gets the root type of this type hierarchy.

shortId : __nonEmptyString

Gets the short identifier of this type.

sourceId : __nonEmptyString

Gets the source module identifier of this type.

styleClass : __nonEmptyString

Gets or sets the CSS class associated with this type.

uid : number

Gets the unique identifier of this type.

Methods

Name Description
_areEqual(va, vb) : boolean
 
Protected

Gets a value that indicates if two distinct, non-Nully values are, nonetheless, considered equal.

_compare(va, vb) : number
 
Protected

Compares two non-equal, non-Nully values according to their order.

_fillSpecInContext(spec, keyArgs) : boolean
 
Protected

Fills the given specification with this type's attributes' local values, and returns whether any attribute was actually added.

_getLabelDefault() : string
 
Protected

Gets the default label to use when the label is not set.

_init(spec, keyArgs)
 
Protected

Performs initialization tasks that take place before the instance is extended with its specification.

_isEqual(va, vb) : boolean
 
Protected

Gets a value that indicates if one instance of this type is considered equal to a distinct, non-nully value, but possibly not a value instance.

_postInit(spec, keyArgs)
 
Protected

Performs initialization tasks that take place after the instance is extended with its specification.

_validate(value) : Array.<pentaho.type.ValidationError>
 
Protected

Determines if the given complex value is a valid instance of this type.

add(propTypeSpec) : pentaho.type.Complex

Adds, overrides or configures properties to/of the complex type.

areEqual(va, vb) : boolean

Gets a value that indicates if two given values are considered equal.

at(index, sloppy) : pentaho.type.Property.Type

Gets the property type object of the property with a given index, if in range, or null if not.

buildSourceRelativeId(id) : string

Builds an absolute module identifier from one that is relative to the type's source location.

compare(va, vb) : number

Compares two values according to their order.

create(instRef, instKeyArgs) : pentaho.type.Instance

Creates or resolves an instance of this type given an instance reference.

createAsync(instRef, instKeyArgs) : Promise.<pentaho.type.Instance>

Creates or resolves an instance of this type, asynchronously, given an instance reference.

each(f, x) : pentaho.type.Complex

Calls a function for each defined property type.

eachCommonWith(otherType, fun, ctx) : pentaho.type.Complex

Calls a function for each defined property type that this type shares with another given type and whose value can, in principle, be copied from it.

get(name, sloppy) : pentaho.type.Property.Type

Gets the type object of the property with the given name, or null if it is not defined.

has(name) : boolean

Gets a value that indicates if a given property is defined.

is(value) : boolean

Determines if a value is an instance of this type.

isSubtypeOf(superType) : boolean

Determines if this is a subtype of another.

isValid(value) : boolean

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

to(value, keyArgs) : pentaho.type.Instance

Converts a value to an instance of this type, if it is not one already.

toJSON() : UJsonValue

Creates a JSON specification that describes this type.

toRef(keyArgs) : pentaho.type.spec.UTypeReference

Returns a reference to this type.

toRefInContext(keyArgs) : pentaho.type.spec.UTypeReference

Returns a reference to this type under a given specification context.

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

Creates a specification that describes this type.

toSpecInContext(keyArgs) : pentaho.type.spec.ITypeProto

Creates a specification that describes this type.

toString() : string

Returns a textual representation suitable to identify this type in an error message.

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

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

Constructor Details

new Type()
 
Static

Source: javascript/web/pentaho/data/filter/_core/isLessOrEqual.js, line 24

Members Details

_isLabelSet: boolean
 
Protected

Gets a value that indicates if the label is locally set.

Source: javascript/web/pentaho/type/_type.js, line 640

Inherited From: pentaho.type.Type#_isLabelSet

alias: __nonEmptyString

Gets the alias for the identifier of this type.

The alias of a type can only be specified when extending the ancestor type.

This attribute is not inherited.

When unspecified, defaults to null.

Source: javascript/web/pentaho/type/_type.js, line 503

Overrides: pentaho.data.filter.Property.Type#alias

See also:  pentaho.type.Type#id

ancestor: pentaho.type.Type

Gets the parent type in the current type hierarchy, if any, or null.

The root type returns null.

Source: javascript/web/pentaho/type/_type.js, line 266

Inherited From: pentaho.type.Type#ancestor

See also:  pentaho.type.Type#root , pentaho.type.Type#hasDescendants

application: object

Gets or sets the application attribute of this type.

The application property serves as a collection of properties specific to the container application that can be modified via the Configuration Service.

Setting this to a Nully value will have no effect.

Source: javascript/web/pentaho/type/_type.js, line 658

Inherited From: pentaho.type.Type#application

category: __nonEmptyString

Gets or sets the category associated with this type.

The category is used primarily to group similar types (or instances of) in a user interface.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, thus ignoring any inherited value.

Source: javascript/web/pentaho/type/_type.js, line 727

Inherited From: pentaho.type.Type#category

See also:  pentaho.type.Type#isBrowsable , pentaho.type.Type#ordinal

context: pentaho.type.Context

Gets the context that defined this type class.

Source: javascript/web/pentaho/type/_type.js, line 181

Inherited From: pentaho.type.Type#context

count:

Gets the number of properties of the complex type.

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

Inherited From: pentaho.type.Complex.Type#count

defaultView: string

Gets or sets the default view for instances of this type.

The identifier of the view's AMD module. If the identifier is relative, it is relative to sourceId.

Setting this to undefined causes the default view to be inherited from the ancestor type, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to a falsy value (like null or an empty string), clears the value of the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/_type.js, line 973

Inherited From: pentaho.type.Type#defaultView

See also:  pentaho.type.Type#buildSourceRelativeId

defaultViewAbs: string

Gets the absolute view module identifier, if any.

A default view exists if property pentaho.type.Type#defaultView has a non-null value.

Source: javascript/web/pentaho/type/_type.js, line 1008

Inherited From: pentaho.type.Type#defaultViewAbs

See also:  pentaho.type.Type#defaultView

description: __nonEmptyString

Gets or sets the description of this type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where this attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/_type.js, line 687

Inherited From: pentaho.type.Type#description

hasDescendants: boolean

Gets a value that indicates if this type has any descendant types.

Source: javascript/web/pentaho/type/_type.js, line 279

Inherited From: pentaho.type.Type#hasDescendants

See also:  pentaho.type.Type#ancestor

helpUrl: __nonEmptyString

Gets or sets a URL pointing to documentation associated with this type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

Setting this to undefined causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is null.

Setting this to null or to an empty string clears the attribute and sets it to null, ignoring any inherited value.

Source: javascript/web/pentaho/type/_type.js, line 763

Inherited From: pentaho.type.Type#helpUrl

id: __nonEmptyString

Gets the identifier of this type.

The identifier of a type can only be specified when extending the ancestor type.

The identifier is only defined for types which have an associated AMD/RequireJS module. However, note that all have a pentaho.type.Type#uid.

This attribute is not inherited.

When unspecified, defaults to the value of sourceId.

Source: javascript/web/pentaho/type/_type.js, line 416

Overrides: pentaho.data.filter.Property.Type#id

See also:  pentaho.type.Type#sourceId

inheritedStyleClasses: Array.<string>

Gets the style classes of this and any base types.

The returned array should not be modified.

Source: javascript/web/pentaho/type/_type.js, line 896

Inherited From: pentaho.type.Type#inheritedStyleClasses

instance: pentaho.type.Instance

Gets the prototype of the instances of this type.

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

Inherited From: pentaho.type.Type#instance

isAbstract: boolean

Gets a value that indicates if this type is abstract.

This attribute can only be set once, upon the type definition.

Source: javascript/web/pentaho/type/_type.js, line 526

Inherited From: pentaho.type.Type#isAbstract

Default Value: false

isAdvanced: boolean

Gets or sets the isAdvanced attribute of this type.

Types with isAdvanced attributes set to false are typically immediately accessible to the user. An advanced type typically escapes the expected flow of utilization, yet it is sufficiently relevant to be shown in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is false.

Source: javascript/web/pentaho/type/_type.js, line 830

Inherited From: pentaho.type.Type#isAdvanced

See also:  pentaho.type.Type#isBrowsable

isBrowsable: boolean

Gets or sets the isBrowsable attribute of this type.

Browsable types are exposed to the end user. Set this attribute to false to prevent exposing the type in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is true.

Source: javascript/web/pentaho/type/_type.js, line 796

Inherited From: pentaho.type.Type#isBrowsable

isComplex: boolean

Gets a value that indicates if this type is a complex type.

Source: javascript/web/pentaho/type/_type.js, line 376

Inherited From: pentaho.type.Type#isComplex

isContainer: boolean

Gets a value that indicates if this type is a list or a complex type.

Source: javascript/web/pentaho/type/_type.js, line 340

Inherited From: pentaho.type.Type#isContainer

isElement: boolean

Gets a value that indicates if this type is an element type.

Source: javascript/web/pentaho/type/_type.js, line 364

Inherited From: pentaho.type.Type#isElement

isList: boolean

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

Source: javascript/web/pentaho/type/_type.js, line 352

Inherited From: pentaho.type.Type#isList

isProperty: boolean

Gets a value that indicates if this type is a property type.

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

Inherited From: pentaho.type.Type#isProperty

isRoot: boolean

Gets a value that indicates if this type is the root of its type hierarchy.

Source: javascript/web/pentaho/type/_type.js, line 250

Inherited From: pentaho.type.Type#isRoot

See also:  pentaho.type.Type#root

isSimple: boolean

Gets a value that indicates if this type is a simple type.

Source: javascript/web/pentaho/type/_type.js, line 388

Inherited From: pentaho.type.Type#isSimple

isValue: boolean

Gets a value that indicates if this type is a value type.

Source: javascript/web/pentaho/type/_type.js, line 315

Inherited From: pentaho.type.Type#isValue

label: __nonEmptyString

Gets or sets the label of this type.

When set to a non-Nully and non-String value, the value is first replaced by the result of calling its toString method.

When set to an empty string or a nully value, the attribute value is reset.

When reset, the attribute assumes its default value (except on the top-root type, Instance.type, in which case it has no effect).

The default value is the inherited value.

The initial value of the attribute on the top-root type is "instance".

Source: javascript/web/pentaho/type/_type.js, line 601

Inherited From: pentaho.type.Type#label

mixins: Array.<pentaho.type.Type>

Gets or sets the mixin types that are locally mixed into this type.

Can be set to either type identifiers, instance classes or type instances and arrays thereof.

The attributes defined by the added mixin types become available for extension/configuration on this type. When extending, mixins are always applied first.

When set to a Nully value, nothing is done.

Source: javascript/web/pentaho/type/_type.js, line 545

Inherited From: pentaho.type.Type#mixins

ordinal: number

Gets or sets the ordinal associated with this type.

The ordinal is used to disambiguate the order with which a type (or an instance of it) is shown in a user interface.

Setting this to a Nully value causes this attribute to use the inherited value, except for the root type, Instance.type (which has no ancestor), where the attribute is 0.

Source: javascript/web/pentaho/type/_type.js, line 930

Inherited From: pentaho.type.Type#ordinal

See also:  pentaho.type.Type#isBrowsable , pentaho.type.Type#category

root: pentaho.type.Type

Gets the root type of this type hierarchy.

Even though the ultimate type root of types defined in this system is Instance, the system is designed to represent multiple type hierarchies, each representing concrete, more meaningful concepts.

When deriving a type from Instance, it can be marked as the root of a type hierarchy, by specifying the isRoot keyword argument to extend.

Typically, root types are immediate subtypes of Instance. However, this is not enforced and it is up to the developer to decide at what level a practical, meaningful type root arises.

For example, Value is the root of value types. However, Property, also an immediate subtype of Instance, is not considered a root type. It is the immediate subtypes of Property (each root property within a complex type) which are considered roots. This aligns with users expectations of what an attribute named root in a property type should mean.

Source: javascript/web/pentaho/type/_type.js, line 207

Inherited From: pentaho.type.Type#root

See also:  pentaho.type.Type#isRoot , pentaho.type.Type#ancestor

shortId: __nonEmptyString

Gets the short identifier of this type.

The short identifier of a type is equal to its alias, provided it is defined. Otherwise, it is equal to the identifier.

Source: javascript/web/pentaho/type/_type.js, line 461

Inherited From: pentaho.type.Type#shortId

See also:  pentaho.type.Type#id , pentaho.type.Type#alias

sourceId: __nonEmptyString

Gets the source module identifier of this type.

The source identifier is the module identifier of the actual AMD/RequireJS module that provides the type and may be different from the identifier when an AMD package or custom mapping is configured for the module.

The source identifier is used to resolve module identifiers relative to the source module, as is the case with the pentaho.type.Type#defaultView attribute.

The source identifier of a type can only be specified when extending the ancestor type.

This attribute is not inherited.

When unspecified, defaults to the value of id.

Source: javascript/web/pentaho/type/_type.js, line 446

Inherited From: pentaho.type.Type#sourceId

See also:  pentaho.type.Type#id , pentaho.type.Type#defaultView

styleClass: __nonEmptyString

Gets or sets the CSS class associated with this type.

This attribute is typically used to associate an icon with a type.

Attempting to set to a non-string value type implicitly converts the value to a string before assignment.

An empty string or null clears the property value.

Setting to undefined, makes the property assume its default value.

The default value of a type with an id is the identifier converted to snake-case, plus special characters like \, /, _, . and spaces are converted to: a dash (). For example: "pentaho/visual/models/heatGrid" would have a default styleClass of: "pentaho-visual-ccc-heat-grid". The default value of an anonymous type is null.

Source: javascript/web/pentaho/type/_type.js, line 874

Inherited From: pentaho.type.Type#styleClass

uid: number

Gets the unique identifier of this type.

Unique type identifiers are auto-generated in each session.

Note that even anonymous types (those whose pentaho.type.Type#id is null) have a unique identifier.

This attribute is not inherited.

Source: javascript/web/pentaho/type/_type.js, line 201

Inherited From: pentaho.type.Type#uid

Methods Details

_areEqual(va, vb) : boolean
 
Protected

Gets a value that indicates if two distinct, non-Nully values are, nonetheless, considered equal.

The default implementation checks if one of the values is a value instance, and, if so, delegates the operation to its type's pentaho.type.Value#_isEqual method.

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

Inherited From: pentaho.type.Value.Type#_areEqual

Parameters:
Name Default Value Summary
va : any

The first value.

vb : any

The second value.

Returns:
Name Description
boolean

true if two values are considered equal; false, otherwise.

See also:  pentaho.type.Value.Type#areEqual

_compare(va, vb) : number
 
Protected

Compares two non-equal, non-Nully values according to their order.

The default implementation compares the two values by natural ascending order of their data type. If both values are numbers, numeric order is used. Otherwise, their string representations are compared in lexicographical order.

Source: javascript/web/pentaho/type/element.js, line 139

Inherited From: pentaho.type.Element.Type#_compare

Parameters:
Name Default Value Summary
va : any

The first value.

vb : any

The second value.

Returns:
Name Description
number

-1 if va is considered before vb; 1 is va is considered after vb; 0, otherwise.

_fillSpecInContext(spec, keyArgs) : boolean
 
Protected

Fills the given specification with this type's attributes' local values, and returns whether any attribute was actually added.

This method requires that there currently exists an ambient specification context.

This method does not add the special id and base attributes to the specification.

Source: javascript/web/pentaho/type/_type.js, line 1315

Inherited From: pentaho.type.Type#_fillSpecInContext

Parameters:
Name Default Value Summary
spec : Object

The specification to be filled.

keyArgs : Object
 
Optional

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

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

Returns:
Name Description
boolean

Returns true if any attribute was added; false, otherwise.

See also:  pentaho.type.Instance#toSpecInContext

_getLabelDefault() : string
 
Protected

Gets the default label to use when the label is not set.

Source: javascript/web/pentaho/type/_type.js, line 629

Inherited From: pentaho.type.Type#_getLabelDefault

Returns:
Name Description
string | null

The default label or an empty value.

_init(spec, keyArgs)
 
Protected

Performs initialization tasks that take place before the instance is extended with its specification.

This method is typically overridden to block the inheritance of certain attributes.

Source: javascript/web/pentaho/type/_type.js, line 150

Inherited From: pentaho.type.Type#_init

Parameters:
Name Default Value Summary
spec : pentaho.type.spec.ITypeProto

The specification of this type.

keyArgs : Object

Keyword arguments.

Parameters:
Name Default Value Summary
instance : pentaho.type.Instance

The prototype of the Instance class associated with this type.

isRoot : boolean
 
Optional
false

If true, creates a root type.

_isEqual(va, vb) : boolean
 
Protected

Gets a value that indicates if one instance of this type is considered equal to a distinct, non-nully value, but possibly not a value instance.

The default implementation considers two values equal if they have the same constructor and equal keys.

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

Inherited From: pentaho.type.Value.Type#_isEqual

Parameters:
Name Default Value Summary
va : pentaho.type.Value

The value instance.

vb : any

The other value.

Returns:
Name Description
boolean

true if two values are considered equal; false, otherwise.

See also:  pentaho.type.Value.Type#areEqual

_postInit(spec, keyArgs)
 
Protected

Performs initialization tasks that take place after the instance is extended with its specification.

This method is typically overridden to validate or default the values of the attributes.

Source: javascript/web/pentaho/type/_type.js, line 170

Inherited From: pentaho.type.Type#_postInit

Parameters:
Name Default Value Summary
spec : Object

The specification of this type.

keyArgs : Object

Keyword arguments.

_validate(value) : Array.<pentaho.type.ValidationError>
 
Protected

Determines if the given complex value is a valid instance of this type.

The default implementation validates each property's value against the property's valueType and collects and returns any reported errors. Override to complement with a type's specific validation logic.

You can use the error utilities in pentaho.type.Util to help in the implementation.

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

Inherited From: pentaho.type.Complex.Type#_validate

Parameters:
Name Default Value Summary
value : pentaho.type.Value

The value to validate.

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

A non-empty array of errors or null.

add(propTypeSpec) : pentaho.type.Complex

Adds, overrides or configures properties to/of the complex type.

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

Inherited From: pentaho.type.Complex.Type#add

Parameters:
Name Default Value Summary
propTypeSpec : pentaho.type.spec.IPropertyTypeProto | Array.<pentaho.type.spec.IPropertyTypeProto>
  • A property type specification or an array of them.
Returns:
Name Description
pentaho.type.Complex

This object.

areEqual(va, vb) : boolean

Gets a value that indicates if two given values are considered equal.

Two values are considered equal if they represent the same real-world entity.

If two values are considered equal, their value instances must have an equal key. Conversely, if they are considered different, their value instances must have a different $key.

If the values are identical as per JavaScript's === operator, true is returned. If both values are Nully, true is returned. If only one is Nully, false is returned. Otherwise, the operation is delegated to the pentaho.type.Value#_areEqual method.

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

Inherited From: pentaho.type.Value.Type#areEqual

Parameters:
Name Default Value Summary
va : any

The first value.

vb : any

The second value.

Returns:
Name Description
boolean

true if two values are considered equal; false, otherwise.

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

at(index, sloppy) : pentaho.type.Property.Type

Gets the property type object of the property with a given index, if in range, or null if not.

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

Inherited From: pentaho.type.Complex.Type#at

Parameters:
Name Default Value Summary
index : number

The property index.

sloppy : boolean
 
Optional
false

Indicates if an error is thrown if the specified index is out of range.

Returns:
Name Description
pentaho.type.Property.Type | null

The property type object, or null.

Throws:
Name Description
pentaho.lang.ArgumentRangeError

When sloppy is false and the specified index is out of range.

buildSourceRelativeId(id) : string

Builds an absolute module identifier from one that is relative to the type's source location.

Relative module identifiers start with a . and do not end with ".js". For example, "./view" and "../view", but not ./view.js.

Absolute identifiers are returned without modification.

Source: javascript/web/pentaho/type/_type.js, line 480

Inherited From: pentaho.type.Type#buildSourceRelativeId

Parameters:
Name Default Value Summary
id : string

A module identifier.

Returns:
Name Description
string

An absolute module identifier.

See also:  pentaho.type.Type#sourceId

compare(va, vb) : number

Compares two values according to their order.

If the two values are identical, as per JavaScript's === operator, they have the same order. If both values are Nully, they have the same order. If only one of the values is Nully, that value is considered to occur before, and the other, after. If the two values are considered equal according to pentaho.type.Value.Type#_areEqual, then they have the same order. Otherwise, the operation is delegated to pentaho.type.Element.Type#_compare.

Source: javascript/web/pentaho/type/element.js, line 114

Inherited From: pentaho.type.Element.Type#compare

Parameters:
Name Default Value Summary
va : any

The first value.

vb : any

The second value.

Returns:
Name Description
number

-1 if va is considered before vb; 1 is va is considered after vb; 0, otherwise.

create(instRef, instKeyArgs) : pentaho.type.Instance

Creates or resolves an instance of this type given an instance reference.

This method delegates to InstancesContainer#get with this type as the typeBase argument.

Source: javascript/web/pentaho/type/_type.js, line 1115

Inherited From: pentaho.type.Type#create

Parameters:
Name Default Value Summary
instRef : pentaho.type.spec.UInstanceReference
 
Optional

An instance reference.

instKeyArgs : Object
 
Optional

The keyword arguments passed to the instance constructor, when one is created.

Returns:
Name Description
pentaho.type.Instance

The created instance or the resolved instance (possibly null).

Throws:
Name Description
Error

Other errors, as documented in: InstancesContainer#get.

See also:  pentaho.type.Type#createAsync , pentaho.type.Type#to , pentaho.type.Type#is

Examples

Create a complex instance from a specification that contains the type inline.

require(["pentaho/type/Context"], function(Context) {

 Context.createAsync({application: "data-explorer-101"})
 .then(function(context) {

 var Value = context.get("value");

 var product = Value.type.create({
 _: {
 props: ["id", "name", {name: "price", valueType: "number"}]
 },

 id: "mpma",
 name: "Principia Mathematica",
 price: 1200
 });

 // ...
 });
});

Create a list instance from a specification that contains the type inline.

require(["pentaho/type/Context"], function(Context) {

 Context.createAsync({application: "data-explorer-101"})
 .then(function(context) {

 var Value = context.get("value");

 var productList = Value.type.create({
 _: [{
 props: ["id", "name", {name: "price", valueType: "number"}]
 }],

 d: [
 {id: "mpma", name: "Principia Mathematica", price: 1200},
 {id: "flot", name: "The Laws of Thought", price: 500}
 ]
 });

 // ...
 });
});

Create an instance from a specification that does not contain the type inline.

require(["pentaho/type/Context"], function(Context) {

 Context.createAsync({application: "data-explorer-101"})
 .then(function(context) {

 var ProductList = context.get([{
 props: [
 "id",
 "name",
 {name: "price", valueType: "number"}
 ]
 }]);

 // Provide the default type, in case the instance spec doesn't provide one.
 var productList = ProductList.type.create(
 [
 {id: "mpma", name: "Principia Mathematica", price: 1200},
 {id: "flot", name: "The Laws of Thought", price: 500}
 ]);

 // ...
 });
});
createAsync(instRef, instKeyArgs) : Promise.<pentaho.type.Instance>

Creates or resolves an instance of this type, asynchronously, given an instance reference.

This method delegates to InstancesContainer#getAsync with this type as the typeBase argument.

Source: javascript/web/pentaho/type/_type.js, line 1136

Inherited From: pentaho.type.Type#createAsync

Parameters:
Name Default Value Summary
instRef : pentaho.type.spec.UInstanceReference
 
Optional

An instance reference.

instKeyArgs : Object
 
Optional

The keyword arguments passed to the instance constructor, when one is created.

Returns:
Name Description
Promise.<pentaho.type.Instance>

A promise to the created instance or resolved instance (possibly null).

See also:  pentaho.type.Type#create

each(f, x) : pentaho.type.Complex

Calls a function for each defined property type.

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

Inherited From: pentaho.type.Complex.Type#each

Parameters:
Name Default Value Summary
f : function

The mapping function. Return false to break iteration.

x : Object
 
Optional

The JS context object on which f is called.

Returns:
Name Description
pentaho.type.Complex

This object.

eachCommonWith(otherType, fun, ctx) : pentaho.type.Complex

Calls a function for each defined property type that this type shares with another given type and whose value can, in principle, be copied from it.

This method finds the lowest common ancestor of both types. If it is a complex type, each of the corresponding local properties is yielded.

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

Inherited From: pentaho.type.Complex.Type#eachCommonWith

Parameters:
Name Default Value Summary
otherType : pentaho.type.Type

The other type.

fun : function

The mapping function. Return false to break iteration.

ctx : Object
 
Optional

The JS context object on which fun is called.

Returns:
Name Description
pentaho.type.Complex

This object.

get(name, sloppy) : pentaho.type.Property.Type

Gets the type object of the property with the given name, or null if it is not defined.

If a property type object is specified, it is returned back only if it is the property type object of same name in this complex type.

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

Inherited From: pentaho.type.Complex.Type#get

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
pentaho.type.Property.Type | null

The property type object.

Throws:
Name Description
pentaho.lang.ArgumentInvalidError

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

has(name) : boolean

Gets a value that indicates if a given property is defined.

If a property type object is specified, this method tests whether it is the same property type object that exists under that name, if any.

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

Inherited From: pentaho.type.Complex.Type#has

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 defined; false, otherwise.

is(value) : boolean

Determines if a value is an instance of this type.

Source: javascript/web/pentaho/type/_type.js, line 1179

Inherited From: pentaho.type.Type#is

Parameters:
Name Default Value Summary
value : any

The value to test.

Returns:
Name Description
boolean

true if the value is an instance of this type; false, otherwise.

isSubtypeOf(superType) : boolean

Determines if this is a subtype of another.

A type is considered a subtype of itself.

Source: javascript/web/pentaho/type/_type.js, line 1191

Inherited From: pentaho.type.Type#isSubtypeOf

Parameters:
Name Default Value Summary
superType : pentaho.type.Type

The candidate super-type.

Returns:
Name Description
boolean

true if this is a subtype of superType type; false, otherwise.

isValid(value) : boolean

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

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

The isValid method can be seen as a stronger version of pentaho.type.Value.Type#is.

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

Inherited From: pentaho.type.Value.Type#isValid

Parameters:
Name Default Value Summary
value : any

The value to validate.

Returns:
Name Description
boolean

true if the value is a valid instance of this type, false if not.

to(value, keyArgs) : pentaho.type.Instance

Converts a value to an instance of this type, if it is not one already.

If a Nully value is specified, null is returned.

Otherwise, if a given value is not already an instance of this type (checked using is), this method delegates the creation of an instance to create.

Source: javascript/web/pentaho/type/_type.js, line 1212

Inherited From: pentaho.type.Type#to

Parameters:
Name Default Value Summary
value : any

The value to convert.

keyArgs : Object
 
Optional

The keyword arguments passed to create, when a new instance is created.

Returns:
Name Description
pentaho.type.Instance | null

The converted value or null.

toJSON() : UJsonValue

Creates a JSON specification that describes this type.

Attributes which do not have a JSON-compatible specification are omitted. Specifically, 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/_type.js, line 1290

Inherited From: pentaho.type.Type#toJSON

Returns:
Name Description
UJsonValue

A JSON-compatible specification.

See also:  pentaho.type.Instance#toSpec

toRef(keyArgs) : pentaho.type.spec.UTypeReference

Returns a reference to this type.

This method returns a reference to this type that is appropriate to be the value of an inline type property that is included on a specification of an instance of this type.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current.

When a type is not anonymous, the id is returned.

For anonymous types, a temporary, serialization-only identifier is generated. In the first occurrence in the given scope, that identifier is returned, within a full specification of the type, obtained by calling toSpecInContext. In following occurrences, only the previously used temporary identifier is returned.

Some standard types have a special reference syntax. For example: List.Type#toRef.

Source: javascript/web/pentaho/type/_type.js, line 1408

Inherited From: pentaho.type.Type#toRef

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

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

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

Returns:
Name Description
pentaho.type.spec.UTypeReference

A reference to this type.

See also:  pentaho.type.Type#toSpec

toRefInContext(keyArgs) : pentaho.type.spec.UTypeReference

Returns a reference to this type under a given specification context.

This method requires that there currently exists an ambient specification context.

Source: javascript/web/pentaho/type/_type.js, line 1428

Inherited From: pentaho.type.Type#toRefInContext

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

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

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

Returns:
Name Description
pentaho.type.spec.UTypeReference

A reference to this type.

See also:  pentaho.type.Type#toRef

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

Creates a specification that describes this type.

If an ambient specification context, currently exists, it is used to manage the serialization process. Otherwise, one is created and set as current.

This method creates a new pentaho.type.SpecificationScope for describing this type, and any other instances and types it references, and then delegates the actual work to pentaho.type.Type#toSpecInContext.

Source: javascript/web/pentaho/type/_type.js, line 1243

Inherited From: pentaho.type.Type#toSpec

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

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

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

Parameters:
Name Default Value Summary
isJson : boolean
 
Optional
false

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

Returns:
Name Description
pentaho.type.spec.ITypeProto

A specification of this type.

See also:  pentaho.type.Type#toSpecInContext , pentaho.type.Type#_fillSpecInContext

toSpecInContext(keyArgs) : pentaho.type.spec.ITypeProto

Creates a specification that describes this type.

This method requires that there currently exists an ambient specification context.

The default implementation returns a plain object with the identifier of the type and any other specified attributes (like label or description).

Source: javascript/web/pentaho/type/_type.js, line 1266

Inherited From: pentaho.type.Type#toSpecInContext

Parameters:
Name Default Value Summary
keyArgs : Object
 
Optional

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

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

Returns:
Name Description
pentaho.type.spec.ITypeProto

A specification of this type.

See also:  pentaho.type.Type#toSpec

toString() : string

Returns a textual representation suitable to identify this type in an error message.

Source: javascript/web/pentaho/type/_type.js, line 1439

Inherited From: pentaho.type.Type#toString

Returns:
Name Description
string

A textual representation.

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

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

Validation of value proceeds as follows:

  1. If it is Nully, an error is returned
  2. If it does not satisfy is, an error is returned
  3. Validation is delegated to _validate.

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

Inherited From: pentaho.type.Value.Type#validate

Parameters:
Name Default Value Summary
value : any

The value to validate.

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

A non-empty array of errors or null.

See also:  pentaho.type.Value#validate , pentaho.type.Value.Type#isValid , pentaho.type.Value.Type#_validate