Description | Hierarchy | Fields | Methods | Properties |
type unaIdList = class(unaList)
This list is usefull when you wish to access items by their IDs rather than by indexes.
It uses internal array to store the ID of every item, so item could be located much faster.
function indexOfId(id: int64; startingIndex: int = 0): int; |
|
function itemById(id: int64; startingIndex: int = 0): pointer; |
|
function removeById(id: int64; doFree: unsigned = 2): bool; |
|
function updateId(index: int): bool; |
|
function updateIds(): unsigned; |
|
function doAdd(item: pointer): int; override; |
|
function doCopyFrom(list: pointer; listSize: int = -1; copyOperation: unaListCopyOpEnum = unaco_add; startIndex: int = 0): int; override; |
|
function doInsert(index: int; item: pointer; brokeSorted: bool = true): int; override; |
|
function getId(item: pointer): int64; virtual; abstract; |
|
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure doReverse(); override; |
|
procedure doSetCapacity(value: unsigned; force: bool); override; |
|
procedure doSetItem(index: int; item: pointer; brokeSorted: bool = true; doFree: unsigned = 2); override; |
|
procedure notifyBeforeRemove(index: int); override; |
property allowDuplicateId: bool read f_allowDI write f_allowDI; |
function indexOfId(id: int64; startingIndex: int = 0): int; |
|
Returns index of first item with given ID. |
function itemById(id: int64; startingIndex: int = 0): pointer; |
|
Returns first item with given ID. |
function removeById(id: int64; doFree: unsigned = 2): bool; |
|
Removes item with specified ID. |
function updateId(index: int): bool; |
|
Assigns new Id for item with specified index. |
function updateIds(): unsigned; |
|
Assigns new Ids for each item in the list. Returns number of items updated. |
function doAdd(item: pointer): int; override; |
|
function doCopyFrom(list: pointer; listSize: int = -1; copyOperation: unaListCopyOpEnum = unaco_add; startIndex: int = 0): int; override; |
|
function doInsert(index: int; item: pointer; brokeSorted: bool = true): int; override; |
|
function getId(item: pointer): int64; virtual; abstract; |
|
Override this method to provide some implementation of returning the ID of the item. |
procedure AfterConstruction(); override; |
|
procedure BeforeDestruction(); override; |
|
procedure doReverse(); override; |
|
procedure doSetCapacity(value: unsigned; force: bool); override; |
|
procedure doSetItem(index: int; item: pointer; brokeSorted: bool = true; doFree: unsigned = 2); override; |
|
procedure notifyBeforeRemove(index: int); override; |
|
property allowDuplicateId: bool read f_allowDI write f_allowDI; |
|
(c) 2012 Lake of Soft