Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi multiple indexed generic list

I am looking for a TList descendent which lets me add one or more indexes and lets me search and view by these indexes.

A 30min google search session has left me with nothing.

This must have been needed before. I mean how many times have you had a in memory indexed collection and then needed to display it in a different order?

Thanks,

AJ

like image 607
AJ. Avatar asked Dec 12 '22 06:12

AJ.


2 Answers

Have you considered TClientDataSet? It can be sorted and filtered at runtime. An article can be found at http://edn.embarcadero.com/article/29056

like image 103
mjn Avatar answered Dec 28 '22 01:12

mjn


If you are looking for a generic implementation of a Multimap in Delphi, LU RD has pointed to you the right direction in his comment above on delphi-coll.

The namespace Collections.MultiMaps provides a bunch of classes:

  • TDistinctMultiMap: The generic multi-map collection.
  • TDoubleSortedDistinctMultiMap: The generic multi-map collection.
  • TDoubleSortedMultiMap: The generic multi-map collection.
  • TMultiMap: The generic multi-map collection.
  • TObjectDistinctMultiMap: The generic multi-map collection designed to store objects.
  • TObjectDoubleSortedDistinctMultiMap: The generic multi-map collection designed to store objects.
  • TObjectDoubleSortedMultiMap: The generic multi-map collection designed to store objects.
  • TObjectMultiMap: The generic multi-map collection designed to store objects.
  • TObjectSortedDistinctMultiMap: The generic distinct multi-map collection designed to store objects.
  • TObjectSortedMultiMap: The generic multi-map collection designed to store objects.
  • TSortedDistinctMultiMap: The generic distinct multi-map collection.
  • TSortedMultiMap: The generic multi-map collection.
like image 23
menjaraz Avatar answered Dec 27 '22 23:12

menjaraz