Adobe Flex and Flash CS3
components and libraries
by Codeiron Ltd.

This text is replaced by the Flash movie.
The Collator class library (version: 1.0.2) provides sort compare functions and SortFields which support several national collation orders, like Hungarian, German, etc. You can use it in Adobe Flex and Flash CS3 projects. For the full list start one of the demos. If there is a mistake in a collation send an e-mail to us and we correct it as soon as possible. The library is distributed with documentation generated by ASDoc.
The Collator library is completely free and is released under the BSD license! The library is provided by Codeiron Ltd. "AS IS".
If the supplied national collation orders don't satisfy your needs, you can define your own collation order. The source code of the classes which implement the national collation orders are included in the distribution package. (The source code of the base classes are not included.) You can read and use them to implement your own collation, but use different package names.
The compare functions and SortFields support multigraphs (digraphs, trigraphs, etc.) (a multigraph is two or more letters treated as a single letter), but it is slower than using only single-graph letters.

Simple Flash CS3 examples:

1.
Create a DataGrid component with a name dg.
In the first frame edit the Actions.
Import the your national collation factory. For example:

import com.fxcomps.collator.hungarian.HungarianMGSCollatorFactory;

In this example the DataGrid has only one column (Name).

...
dg.columns = ["Name"];
var ncf:HungarianMGSCollatorFactory = new HungarianMGSCollatorFactory();
dg.columns[0].sortCompareFunction = ncf.getCaseSensitiveSortCompareFunction("Name");
...

Simple Flex examples:

1.
...
<mx:DataGrid id="dg" dataProvider="{ac}">
<mx:columns>
...
<mx:DataGridColumn id="dgcName" headerText="Name" dataField="name" sortable="true" width="100" sortCompareFunction="{new HungarianCollatorFactory().getCaseSensitiveSortCompareFunction('name')}" />
...
</mx:columns>
</mx:DataGrid>
2.
<mx:Script>
<![CDATA[
...
<!-- Note: ncf must be bindable in this example. -->
protected var ncf:NationalCollatorFactory = new HungarianCollatorFactory();
...
]]>
</mx:Script>
...
<mx:DataGrid id="dg" dataProvider="{ac}">
<mx:columns>
...
<mx:DataGridColumn id="dgcName" headerText="Name" dataField="name" sortable="true" width="100" sortCompareFunction="{ncf.getCaseSensitiveSortCompareFunction('name')}" />
...
</mx:columns>
</mx:DataGrid>

The generated functions have limitations:

The sort is approximately ten times or more slower than the native sort, but it depends on a lot of parameters. It can sort 100000 Strings (all of them are 10 character-long and randomly generated) in 14 seconds if you don't use multigraph letters. If you use multigraph letters, it will be slower. (Computer parameters: Pentium 4 2.4 GHz, 1 GB RAM)

Benchmark* (processing time**):

Number of objects:Native sort:FXComps Czech:FXComps Czech MGS***:FXComps Hungarian:FXComps Hungarian MGS***:
1000765826892
500036442556463648
10000691050133510171410
250002042867377428643952
500004806092831061218779
100000105713781182551387619146
* This result is not an offer. The author can't guarantee it's correctness.
** The processing time is in milliseconds.
*** MGS - Multigraph Support (a collation which contains multigraph letters). Czech MGS collation contains only one digraph ("ch"), Hungarian MGS collation contains a few digraphs and trigraphs. That's why the sorting process is slower when you are using Hungarian MGS collation.