TLinkedStringList

From Ultibo.org
Jump to: navigation, search

Return to Unit UltiboClasses


Description


To be documented

Class definitions



TLinkedStringList = class(TStrings)

Note: A List of TStringObjects with automatic Prev/Next Links

Mostly identical methods to TStringList with addition of First/Last/Next/Prev

 
Note: Currently does not implement Sorting or Duplicate handling
 
constructor Create;  
public (Public destructor for FPC RTL)
destructor Destroy; override;  
private
FCount:Integer;  
FFirst:TStringObject;  
FLast:TStringObject;  
FSorted:Boolean;  
FUpdating:Boolean;  
FDuplicates:TDuplicates;  
FOnChange:TNotifyEvent;  
FOnChanging:TNotifyEvent;  
procedure QuickSort(L,R:Integer);  
procedure SetSorted(Value:Boolean);  
 
function GetItem(AIndex:Integer):TStringObject;  
 
function Link(AValue:TStringObject):Boolean;  
function LinkEx(APrev,AValue:TStringObject):Boolean;  
function Unlink(AValue:TStringObject):Boolean;  
protected
procedure ClearList; virtual;  
 
procedure Changed; virtual;  
procedure Changing; virtual;  
function Get(Index:Integer):String; override;  
function GetCount:Integer; override;  
function GetObject(Index:Integer):TObject; override;  
procedure Put(Index:Integer; const S:String); override;  
procedure PutObject(Index:Integer; AObject:TObject); override;  
procedure SetUpdateState(Updating:Boolean); override;  
public
function Add(const S:String):Integer; override;  
procedure Clear; override;  
procedure Delete(Index:Integer); override;  
procedure Exchange(Index1,Index2:Integer); override;  
function Find(const S:String; var Index:Integer):Boolean; virtual;  
function IndexOf(const S:String):Integer; override;  
procedure Insert(Index:Integer; const S:String); override;  
procedure Sort; virtual;  
property First:TStringObject read FFirst;  
property Last:TStringObject read FLast;  
property Duplicates:TDuplicates read FDuplicates write FDuplicates;  
property Sorted:Boolean read FSorted write SetSorted;  
property OnChange:TNotifyEvent read FOnChange write FOnChange;  
property OnChanging:TNotifyEvent read FOnChanging write FOnChanging;  


Function declarations



constructor TLinkedStringList.Create;
Description: To be documented
Note None documented


destructor TLinkedStringList.Destroy;
Description: To be documented
Note None documented


function TLinkedStringList.GetItem(AIndex:Integer):TStringObject;
Description: To be documented
Note None documented


function TLinkedStringList.Link(AValue:TStringObject):Boolean;
Description: Link AValue to Prev,Next Siblings and Adjust First/Last
Note None documented


function TLinkedStringList.LinkEx(APrev,AValue:TStringObject):Boolean;
Description: Link AValue after APrev Sibling and Adjust First/Last/Prev/Next
Note If APrev is nil then Link as first value in list


function TLinkedStringList.Unlink(AValue:TStringObject):Boolean;
Description: Unlink AValue from Prev,Next Siblings and Adjust First/Last
Note None documented


procedure TLinkedStringList.ClearList;
Description: To be documented
Note None documented


procedure TLinkedStringList.Changed;
Description: To be documented
Note None documented


procedure TLinkedStringList.Changing;
Description: To be documented
Note None documented


function TLinkedStringList.Get(Index:Integer):String;
Description: To be documented
Note None documented


function TLinkedStringList.GetCount:Integer;
Description: To be documented
Note None documented


function TLinkedStringList.GetObject(Index:Integer):TObject;
Description: To be documented
Note None documented


procedure TLinkedStringList.Put(Index:Integer;const S:String);
Description: To be documented
Note None documented


procedure TLinkedStringList.PutObject(Index:Integer; AObject:TObject);
Description: To be documented
Note None documented


procedure TLinkedStringList.SetUpdateState(Updating:Boolean);
Description: To be documented
Note None documented


function TLinkedStringList.Add(const S:String):Integer;
Description: To be documented
Note None documented


procedure TLinkedStringList.Clear;
Description: To be documented
Note None documented


procedure TLinkedStringList.Delete(Index:Integer);
Description: To be documented
Note None documented


procedure TLinkedStringList.Exchange(Index1,Index2:Integer);
Description: To be documented
Note None documented


function TLinkedStringList.IndexOf(const S:String):Integer;
Description: Uses Counted Index starting from First String Object
Note None documented


procedure TLinkedStringList.Insert(Index:Integer; const S:String);
Description: To be documented
Note None documented


Return to Unit Reference