4

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

1
  • 1
    Have you looked at delphi-coll ? Lots of generic list types with different sorting algorithms. Commented Jan 10, 2012 at 17:38

4 Answers 4

7

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

Sign up to request clarification or add additional context in comments.

Comments

7

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.

2 Comments

seems that the repository was changed to this place: github.com/ghquant/delphi-coll
0

You can use a sorted TStringList for your index. While it might be nice if your index were encapsulated into your main list object, that's no reason to let it stop you.

Create a new TStringList and have the Object pointer point to whatever you need.

Comments

-1

I'm not sure if delphi supports multiple indexed lists... Maybe you can try with TMS TColumnListBox?

2 Comments

That sounds like a visual control.
@DavidHeffernan it doesn't just sound like it, it walks like it and it quacks like it, in fact, it simply is...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.