Property :: previousKey - Locate previous key value
The function tries to locate the previous key value according to the selected access key starting at the located instance or a key offset.
The function locates the key value previous to the offset or currently located instance. The function returns the previous key value located. When calling the function for indexes allowing duplicate key values, previousKey() also returns duplicates.
When a filter or key filter has been set, the function locates the previous key value or instance fulfilling the filter condition.
Usually, the instance will be located but not positioned. In case of instance filters or unordered collections, however, the instance will be selected. In order to select the instance located one may call get() .
The function returns the key value. When no instance could be located, when no key is defined (e.g. for untyped collections), or when an error occurred while reading data, the function throws an exception.
The key passed for renaming the instance must be structured according to the currently selected sort order. Key components within a key must be separated by '|' or ';'. An empty string can be passed in order to indicate no key value.
In order to pass no key value, an empty string ( String() ) has to be passed.
Implementation overview
- Locate previous key value from current position
Property :: previousKey (  ) - Locate previous key value for passed offset
Property :: previousKey ( vSortKey ) - Locate previous key value from offset on key level
Property :: previousKey ( vSortKey, iKeyLevel ) - Locate previous instance for key level
Property :: previousKey ( iKeyLevel )
Implementation details
-
Locate previous key value from current position
odaba::Key Property  :: previousKey (  )
The function locates the previous key value starting as current position (last instance located). When no instance is located, the function returns the last key.
to list
-
Locate previous key value for passed offset
odaba::Key Property  :: previousKey ( odaba::Key vSortKey )
The function tries to locate the previous key value starting at key offset passed in vSortKey .
- vSortKey
- Access key
The sort or access key value is provided as typed string in ESDF or CSV format. Key components can be separated by '|' or ';'.
// key: name;first_name
Miller;Paul // simple positioned CSV key
"Miller";"Paul Mary" // special characters must be quoted
to list
- vSortKey
- Access key
-
Locate previous key value from offset on key level
odaba::Key Property  :: previousKey ( odaba::Key vSortKey, int32 iKeyLevel )
The function tries to locate the previous key value starting at key offset passed in vSortKey .
The switch level ( iKeyLevel ) allows defining the last key components that must alter. This allows e.g. reading all key values without duplicates when fixing the last key component.
- vSortKey
- Access key
The sort or access key value is provided as typed string in ESDF or CSV format. Key components can be separated by '|' or ';'.
// key: name;first_name
Miller;Paul // simple positioned CSV key
"Miller";"Paul Mary" // special characters must be quoted
- iKeyLevel
- Number of fixed key component
The switch level defines the key component number that need not change when calling next() or locateKey() beginning with 1 for the first key component.
to list
- vSortKey
- Access key
-
Locate previous instance for key level
odaba::Key Property  :: previousKey ( int32 iKeyLevel )
The switch level ( iKeyLevel ) allows defining the last key components that must alter. This allows e.g. providing all instances without duplicate key values, when fixing the last key component.
- iKeyLevel
- Number of fixed key component
The switch level defines the key component number that need not change when calling next() or locateKey() beginning with 1 for the first key component.
to list
- iKeyLevel
- Number of fixed key component