mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-30 16:23:39 +02:00
316 lines
14 KiB
XML
316 lines
14 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<fpdoc-descriptions>
|
|
<package name="lazutils">
|
|
<!--
|
|
====================================================================
|
|
LookupStringList
|
|
====================================================================
|
|
-->
|
|
<module name="LookupStringList">
|
|
<short>
|
|
Contains TLookupStringList, an unsorted StringList with a fast lookup feature
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Authors: Juha Manninen / Antônio Galvão
|
|
</p>
|
|
</descr>
|
|
|
|
<!-- class Visibility: default -->
|
|
<element name="TLookupStringList" link="#rtl.Classes.TStringList">
|
|
<short>
|
|
Implements an unsorted StringList with a fast lookup feature
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
TLookupStringList is a TStringList descendant that implements an unsorted StringList with a fast lookup feature. Internally it uses a map container to store the strings which are used in the Contains, IndexOf and Find methods. The map container does not reserve too much memory because the strings are reference counted and not copied.
|
|
</p>
|
|
<p>
|
|
All Duplicates property values are fully supported, including dupIgnore and dupError, unlike in unsorted TStringList class.
|
|
</p>
|
|
<p>
|
|
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.
|
|
</p>
|
|
<p>
|
|
Authors: Juha Manninen / Antônio Galvão
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
|
|
<!-- variable Visibility: private -->
|
|
<element name="TLookupStringList.FMap"/>
|
|
|
|
<!-- procedure Visibility: protected -->
|
|
<element name="TLookupStringList.InsertItem" link="#rtl.Classes.TStringList.InsertItem">
|
|
<short>
|
|
Adds a new value to the items and the string map with duplicate enforcement
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
InsertItem is an overridden method which ensures that the internal String map and the Duplicates property are used when an item value is inserted. When Sorted contains False, the value in Duplicates determines the actions taken.
|
|
</p>
|
|
<dl>
|
|
<dt>dupAccept</dt>
|
|
<dd>
|
|
Duplicates are allowed. Inserts the item and adds it to the string map.
|
|
</dd>
|
|
<dt>dupIgnore</dt>
|
|
<dd>
|
|
Ignores duplicates. No actions are performed when S is already in the string map.
|
|
</dd>
|
|
<dt>dupError</dt>
|
|
<dd>
|
|
Raises an Exception if S is already in the string map.
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
InsertItem calls the inherited method, and adds the value in S to the internal string map.
|
|
</p>
|
|
</descr>
|
|
<errors>
|
|
<p>
|
|
Raises an Exception when adding a duplicated value and Duplicates contains dupError. Raised with the message 'TLookupStringList.InsertItem: Duplicates are not allowed.'
|
|
</p>
|
|
</errors>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.InsertItem.Index">
|
|
<short>Position for the new item</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.InsertItem.S">
|
|
<short>Value for the new item</short>
|
|
</element>
|
|
|
|
<!-- constructor Visibility: public -->
|
|
<element name="TLookupStringList.Create" link="#rtl.Classes.TStringList.Create">
|
|
<short>
|
|
Constructor for the class instance
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Create is the constructor for the class instance, and calls the inherited constructor. Create allocates the internal TStringMap instance used in the class.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
|
|
<!-- destructor Visibility: public -->
|
|
<element name="TLookupStringList.Destroy" link="#rtl.Classes.TStringList.Destroy">
|
|
<short>
|
|
Destructor for the class instance
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Destroy is the destructor for the class instance. Destroy frees the internal TStringMap instance allocated in the constructor, and calls the inherited Destroy method.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
|
|
<!-- procedure Visibility: public -->
|
|
<element name="TLookupStringList.Assign" link="#rtl.Classes.TStrings.Assign">
|
|
<short>
|
|
Implements object persistence in the class
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Assign is an overridden method which implements the object persistence mechanism in the class. Assign ensures that property values in Source are stored in the current class instance. Assign calls the inherited method. When Source is a TLookupStringList class instance, the values in its internal string map are also stored in the current class instance.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Assign.Source">
|
|
<short>Persistent object with property values for the class instance</short>
|
|
</element>
|
|
|
|
<!-- procedure Visibility: public -->
|
|
<element name="TLookupStringList.Clear" link="#rtl.Classes.TStringList.Clear">
|
|
<short>
|
|
Clears the content stored in the class instance
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Clear is an overridden method used to clear the content stored in Strings, Objects, and the internal string map. Clear calls the inherited method, and calls the TStringMap.Clear method in the internal string map.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
|
|
<!-- procedure Visibility: public -->
|
|
<element name="TLookupStringList.Delete" link="#rtl.Classes.TStringList.Delete">
|
|
<short>
|
|
Deletes the value at the specified position
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Delete is an overridden method which ensures that the internal string map is maintained when deleting the value stored at the specified position. The corresponding value in Strings is used to check for duplicates using IndexOf. When a duplicate exists, and Duplicates are not allowed, the value is also removed from the internal string map. Delete calls the inherited method to delete the values in Strings and Objects at the position in Index.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Delete.Index">
|
|
<short>Ordinal position of the value to delete</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TLookupStringList.Add" link="#rtl.Classes.TStringList.Add">
|
|
<short>
|
|
Adds the specified value to the Strings in the list
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Add is an overridden Integer function used to enforce handling of Duplicates when adding the specified value to Strings. Add checks the values in Sorted and Duplicates to see if duplicates are allowed in the unsorted String list.
|
|
</p>
|
|
<p>
|
|
The return value is -1 if the value in S already exists in the string map, and no actions are performed in the method. Otherwise, the inherited Add method is called to store the value in S. The return value is the position in Strings where the new value was stored.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- function result Visibility: default -->
|
|
<element name="TLookupStringList.Add.Result">
|
|
<short>
|
|
Ordinal position for the new value, or -1 when duplicates are not allowed
|
|
</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Add.S">
|
|
<short>Value to add to the Strings in the list</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TLookupStringList.AddObject" link="#rtl.Classes.TStrings.AddObject">
|
|
<short>
|
|
Adds the specified values to the Strings and Objects in the list
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
AddObject is an overridden Integer function used to add the specified values to the Strings and Objects in the list. AddObject calls the Add method to add the value in S to Strings.
|
|
</p>
|
|
<p>
|
|
The return value contains the ordinal position in Strings where the value was stored, or -1 when duplicate values are not allowed. If the return value is not -1, the Objects property is updated to include the value in AObject at the specified position.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- function result Visibility: default -->
|
|
<element name="TLookupStringList.AddObject.Result">
|
|
<short>
|
|
Ordinal position for the new values, or -1 when duplicates are not allowed
|
|
</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.AddObject.S">
|
|
<short>Value added to the Strings property</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.AddObject.AObject">
|
|
<short>Value added to the Objects property</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TLookupStringList.Contains">
|
|
<short>
|
|
Determines if the specified value already exists in the string map
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Contains is a Boolean function used to determine if the specified value already exists in the internal string map for the string list. The return value is True when S is already stored in the TStringMap for the class.
|
|
</p>
|
|
<p>
|
|
Contains is called from the Add, InsertItem, and IndexOf methods.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- function result Visibility: default -->
|
|
<element name="TLookupStringList.Contains.Result">
|
|
<short>True when the value is already stored in the TStringMap for the class</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Contains.S">
|
|
<short>Value to locate in the string map</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TLookupStringList.Find" link="#rtl.Classes.TStringList.Find">
|
|
<short>
|
|
Locates the specified value in the Strings property
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Find is an overridden Boolean function used to locate the specified value in the Strings property. The value in Index contains the position in Strings where value was located using the IndexOf method. Index contains -1 if the value in S is not stored in Strings. The return value if True when Index contains a value other than -1.
|
|
</p>
|
|
<p>
|
|
Please note: Find does <b>NOT</b> call the inherited method.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- function result Visibility: default -->
|
|
<element name="TLookupStringList.Find.Result">
|
|
<short>True when the value is located in the Strings property</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Find.S">
|
|
<short>Value to find in the Strings property</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.Find.Index">
|
|
<short>Ordinal position where the value was found</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TLookupStringList.IndexOf" link="#rtl.Classes.TStringList.IndexOf">
|
|
<short>
|
|
Gets the position in Strings where the specified value is stored
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
IndexOf is an overridden Integer function used to get the position in Strings where the specified value is stored. IndexOf uses the internal String map to determine if the value in S is stored in the string list. If S already exists, the inherited method is called.
|
|
</p>
|
|
<p>
|
|
The return value contains the ordinal position for the specified value, or -1 when S does not exist in the string map.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<!-- function result Visibility: default -->
|
|
<element name="TLookupStringList.IndexOf.Result">
|
|
<short>
|
|
Ordinal position for the specified value, or -1 when it does not exist
|
|
</short>
|
|
</element>
|
|
<!-- argument Visibility: default -->
|
|
<element name="TLookupStringList.IndexOf.S">
|
|
<short>Value to locate in Strings</short>
|
|
</element>
|
|
|
|
<element name="Deduplicate">
|
|
<short>
|
|
Removes duplicate strings in AStrings
|
|
</short>
|
|
<descr>
|
|
<p>
|
|
Removes duplicate strings (with case sensitivity) from AStrings. Deduplicate creates a TLookupStringList instance that is used to remove the duplicate values in AStrings. When AStrings owns and contains objects, the function will return False.
|
|
</p>
|
|
</descr>
|
|
<seealso></seealso>
|
|
</element>
|
|
<element name="Deduplicate.AStrings">
|
|
<short>TStrings to examine in the function</short>
|
|
</element>
|
|
<element name="Deduplicate.Result">
|
|
<short>False if AStrings owns and contains objects</short>
|
|
</element>
|
|
|
|
</module>
|
|
<!-- LookupStringList -->
|
|
</package>
|
|
</fpdoc-descriptions>
|