KeyValue
User's Manual - version: 0.1

7. Reserved keys

Some special keys are reserved for KeyValue use. They are explained in the following sections.

7.1. Processor

The task performed on a data set is defined exclusively by its content. Indeed, excluding the Default data set (see Section 9), the value assigned to key Processor informs the action to be performed. More precisely, the bridge library implements a number of processors which perform different tasks on data sets. The value assigned to key Processor gives the name of the processor for a data set.

For instance, in sheet Reserved keys, the formula in B2 selects processor Polygon while the one in E2 selects processor Area. Recalculate B2 to verify in the logger the called processors:

Figure 12. In each data set, its key Processor selects the processor for this data set.

[Debug  ] DataSet: A
Size    : 4
Key   #1: IsRegular
Value #1: [Single] 1
Key   #2: NumberOfEdges
Value #2: [Single] 4
Key   #3: Size
Value #3: [Single] 1
Key   #4: Processor
Value #4: [Single] Polygon
[Debug  ] DataSet:
Size    : 2
Key   #1: Polygon
Value #1: [Single] A
Key   #2: Processor
Value #2: [Single] Area
[Info   ] Processor 'Area' called on anonymous data set.
[Info   ] Processor 'Polygon' called on data set 'A'.


Processors that create objects are called builders (e.g. Polygon). Those that compute results are called calculators (e.g. Area).

Key Processor is optional. A data set which does not have such key is called data-only.

7.2. ProcessNow

In sheet Reserved keys, the formula in B2 actually does not build any polygon. Indeed, for named data sets, by default KeyValue implements a lazy initialization strategy: It avoids to call processors until this is really necessary. In this case, all KEYVALUE does is creating the data set A which latterly might be used to build a polygon. In this example it will happen when we request its area in E2.

For named data sets, key ProcessNow is used to change this behaviour. If ProcessNow is TRUE, then the data set is immediately processed and the result is returned to OpenOffice Calc. Otherwise, KeyValue just creates and stores the data set for latter use and the result returned to OpenOffice Calc is the data set name. Change cell C10 to TRUE and FALSE and check in the logger when the processor is called.

Anonymous data sets are always processed and ProcessNow has no effect. Change F10 and check the logger.

This key is optional and when it cannot be resolved (see Section 9) assumes the value FALSE.

7.3. VectorOutput

When the result of KEYVALUE is a vector the user may choose how this vector should be presented on the spreadsheet: As a column vector, as a row vector or as it is returned by the processor. For this purpose, the key VectorOutput might be assigned to "Row", "Column" or "AsIs".

This key is optional and when it cannot be resolved (see Section 9) assumes the value "AsIs".

7.4. Imports

Key Imports is optional. Its value is a vector of data set names whose keys and values are imported to the current data set. For more details see Section 9.2.

7.5. Export

Key Export is reserved only in Default data set where it defines whether key-value pairs in Default participate in key resolution or not. (See Section 9.)

Valid HTML 4.01 TransitionalValid CSS!