Language:

The Free and Open Productivity Suite
Apache OpenOffice 4.1.4 released

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous


:: com :: sun :: star :: i18n ::

interface XCollator
Description
provides locale-sensitive collation algorithms for string comparison.
Developers Guide
OfficeDev - Implementing a New Locale - XCollator
OfficeDev - Overview and Using the API - XCollator

Methods' Summary
compareSubstring Compare 2 substrings in specific locale and algorithm.  
compareString Compare 2 strings in specific locale and algorithm.  
loadDefaultCollator Load the collator with default algorithm defined in locale data.  
loadCollatorAlgorithm Load a particular collator algorithm for the locale.  
listCollatorAlgorithms List all collator algorithms for a given locale.  
loadCollatorAlgorithmWithEndUserOption Load a collator algorithm with options chosen by end user.  
listCollatorOptions List all end user collator options for a given algorithm.  
Methods' Details
compareSubstring
long
compareSubstring( [in] string  aStr1,
[in] long  nOff1,
[in] long  nLen1,
[in] string  aStr2,
[in] long  nOff2,
[in] long  nLen2 );

Description
Compare 2 substrings in specific locale and algorithm.
Parameter aStr1
First string.
Parameter nOff1
Offset (from 0) of the first string.
Parameter nLen1
Length (from offset) of the first substring.
Parameter aStr2
Second string
Parameter nOff2
Offset (from 0) of the second string.
Parameter nLen2
Length (from offset) of the second substring.
Returns
1 if the first string is greater than the second string
0 if the first string is equal to the second string
-1 if the first string is less than the second string
compareString
long
compareString( [in] string  aStr1,
[in] string  aStr2 );

Description
Compare 2 strings in specific locale and algorithm.
Parameter aStr1
First string.
Parameter aStr2
Second string.
Returns
1 if the first string is greater than the second string
0 if the first string is equal to the second string
-1 if the first string is less than the second string
loadDefaultCollator
long
loadDefaultCollator( [in] ::com::sun::star::lang::Locale  aLocale,
[in] long  nCollatorOptions );

Description
Load the collator with default algorithm defined in locale data.
Parameter aLocale
The locale for this collator.
Parameter nCollatorOptions
A mask of CollatorOptions.
Returns
Returns 0 when loading was successful, otherwise throws runtime exception. In fact the return value should be ignored and the exception be caught instead.
loadCollatorAlgorithm
long
loadCollatorAlgorithm( [in] string  aAlgorithmName,
[in] ::com::sun::star::lang::Locale  aLocale,
[in] long  nCollatorOptions );

Description
Load a particular collator algorithm for the locale.
Parameter aAlgorithmName
The algorithm to load.
Parameter aLocale
The locale for this collator.
Parameter nCollatorOptions
A mask of CollatorOptions.
Returns
Returns 0 when loading was successful, otherwise throws runtime exception.
listCollatorAlgorithms
sequence< string >
listCollatorAlgorithms( [in] ::com::sun::star::lang::Locale  aLocale );

Description
List all collator algorithms for a given locale.
Parameter aLocale
The locale for which to list algorithms.
Returns
A sequence of algorithm names.
loadCollatorAlgorithmWithEndUserOption
void
loadCollatorAlgorithmWithEndUserOption( [in] string  aAlgorithmName,
[in] ::com::sun::star::lang::Locale  aLocale,
[in] sequence< long >  aCollatorOptions );

Description
Load a collator algorithm with options chosen by end user.
Parameter aAlgorithmName
The algorithm name to load.
Parameter aLocale
The locale for this collator.
Parameter aCollatorOptions
A sequence of end user collator options like those returned by XCollator::listCollatorOptions().
listCollatorOptions
sequence< long >
listCollatorOptions( [in] string  aAlgorithmName );

Description
List all end user collator options for a given algorithm.
Parameter aAlgorithmName
The algorithm name for this collator.
Returns
An array of end user options available for the algorithm.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache and the Apache feather logo are trademarks of The Apache Software Foundation. OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.