Difference between revisions of "LazUtils"

From Lazarus wiki
(TDictionaryStringList)
Line 3: Line 3:
 
== TDictionaryStringList ==
 
== TDictionaryStringList ==
  
This is an unsorted StringList with a fast lookup feature. Internally it uses a string map container to store the string again. It is then used for InserItem, Contains, IndexOf and Find methods.
+
This is an unsorted StringList with a fast lookup feature. Internally it uses a string map container to store the string again. It is then used for InserItem, Contains, IndexOf and Find methods. The extra container does not reserve too much memory because the strings are reference counted and not really copied. All Duplicates property values are fully supported, including dupIgnore and dupError, unlike in unsorted StringList.
 
 
The extra container does not reserve too much memory because the strings are reference counted and not really copied.
 
 
 
All Duplicates property values are fully supported, including dupIgnore and dupError, unlike in unsorted StringList.
 
  
 
This class is useful only when you must preserve the order in list, but also need to do fast lookups to see if a string exists, or must prevent duplicates.
 
This class is useful only when you must preserve the order in list, but also need to do fast lookups to see if a string exists, or must prevent duplicates.

Revision as of 13:46, 19 March 2013

TDictionaryStringList

This is an unsorted StringList with a fast lookup feature. Internally it uses a string map container to store the string again. It is then used for InserItem, Contains, IndexOf and Find methods. The extra container does not reserve too much memory because the strings are reference counted and not really copied. All Duplicates property values are fully supported, including dupIgnore and dupError, unlike in unsorted StringList.

This class is useful only when you must preserve the order in list, but also need to do fast lookups to see if a string exists, or must prevent duplicates.