The TSFCList class descends from TStringList and modifies the class to make it more efficient. Also, it adds some helper methods for iterating easily over the list. Finally, it adds an owner which can be notified when the list changes.
The TSFCList class makes the TStringList class more efficient by overriding the Assign and Sort methods. Specifically, Inprise's TStringList does not override the Assign method and can be slow when assigning two sorted TStringLists to each other. The inherited Assign method justs adds the strings from the source object, it doesn't use knowledge about the lists being sorted to not search for the correct place to insert the item into the destination list.
The Structures.TGStringList adds this efficiency (and other improvements). However, the TGStringList is built entirely from scratch so it may be more advantageous to use.
Namespace: Structures
Delphi
|
type
TSFCList = class(TStringList)
end;
|
|
Name
|
Description
|
|
Owner
|
Specifies the Owner of this object. Whenever the list changes, the list will notify the Owner through this interface.
|
Top
|
|
Name
|
Description
|
|
AddObject(string,TObject)
|
Represents method AddObject(string,TObject).
|
|
Assign(TPersistent)
|
Represents method Assign(TPersistent).
|
|
Changed
|
Represents method Changed.
|
|
Changing
|
Represents method Changing.
|
|
Clear
|
Represents method Clear.
|
|
Delete(Integer)
|
Represents method Delete(Integer).
|
|
ForEach(TForEachObjectMethod,TForEachFilterMethod,LongInt)
|
Overloaded. The ForEach method will iterate over the string list calling the Proc object method for every item that passes the FilterFunction (or all items if the FilterFunction is unassigned). The ForEach method allows regular functions and procedures to be passed instead of methods.
Note
|
The order that the items are processed is not guaranteed, just that every item will be evaluated. In fact, this method goes through the items in reverse order so that the Proc method could delete items without affecting items not yet visited. This may change.
|
|
|
ForEach(TForEachObjectProc,TForEachFilterProc,LongInt)
|
Overloaded. The ForEach method will iterate over the string list calling the Proc function for every item that passes the FilterFunction (or all items if the FilterFunction is unassigned). The ForEach method allows class methods to be passed instead of regular functions and procedures.
Note
|
The order that the items are processed is not guaranteed, just that every item will be evaluated. In fact, this method goes through the items in reverse order so that the Proc method could delete items without affecting items not yet visited. This may change.
|
|
|
IndexOf(string)
|
Represents method IndexOf(string).
|
|
Put(Integer,string)
|
Represents method Put(Integer,string).
|
|
PutObject(Integer,TObject)
|
Represents method PutObject(Integer,TObject).
|
|
SetUpdateState(Boolean)
|
Represents method SetUpdateState(Boolean).
|
|
Sort
|
Represents method Sort.
|
Top
|