internal package Foswiki::Query::OP

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Query::OP is a Foswiki::Infix::OP

Base class of operators used in queries. Operators are singleton objects that specify the parser behaviour and are attached to nodes in the parse tree to provide semantics for the nodes.

See Foswiki::Infix::OP for details of the different options used to define operator nodes.

ObjectMethod evaluate($node, %domain) → $value

Pure virtual method that evaluates the operator in the give domain. The domain is a reference to a hash that contains the data being operated on, and a reference to the meta-data of the topic being worked on (the "topic object"). The data being operated on can be a Meta object, a reference to an array (such as attachments), a reference to a hash or a scalar. Arrays can contain other arrays and hashes.

See Foswiki::Query::Node::evaluate for more information.

ObjectMethod evaluatesToConstant() → $boolean

Does this operator always evaluate to a constant? See Foswiki::Query::Node::evaluatesToConstant

Used in hoisting/optimisation.

Default behaviour is to call evaluatesAsConstant on all parameters and return true if they all return true.

StaticMethod isNumber($string) → $boolean

Determine if a string represents a valid number (signed decimal)

Used in hoisting/optimisation.

StaticMethod collect($a, $fn) → []

Invokes $fn once for each element of $a and return an array built from the results.

Topic revision: r1 - 21 Nov 2014, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Moseley Bioinformatics Lab? Send feedback