1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
|
<?xml version="1.0" encoding="UTF-8"?>
<fpdoc-descriptions>
<package name="lazutils">
<!--
====================================================================
LazLinkedList
====================================================================
-->
<module name="LazLinkedList">
<short>Defines a simple doubly linked list.</short>
<descr>
<p>
<file>lazlinkedlist.pas</file> defines a simple doubly linked list (TLinkList). It supports Adding, Deleting, getting First and getting Last in O(1). Finding can be done in time O(n).
</p>
<p>
This file is part of the <file>LazUtils</file> package.
</p>
<p>
Authors: Mattias Gaertner, Jeroen van Iddekinge
</p>
</descr>
<!-- used units -->
<element name="Classes"/>
<element name="SysUtils"/>
<element name="TLinkListItem">
<short>Implements an item in a doubly linked list.</short>
<descr>
<p>
<var>TLinkListItem</var> is a class which implements an item in a doubly linked list. It represents the traversal nodes used in <var>TLinkList</var>, including the terminal (or sentinel) node. Properties are provided to access and maintain the <var>Prior</var> and <var>Next</var> items in the node traversal order.
</p>
</descr>
<seealso>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
<link id="TLinkList.First"/>
<link id="TLinkList.Last"/>
</seealso>
</element>
<element name="TLinkListItem.Next">
<short>Contains a reference to the next item in the doubly linked list.</short>
<descr></descr>
<seealso></seealso>
</element>
<element name="TLinkListItem.Prior">
<short>Contains a reference to the previous item in the doubly linked list.</short>
<descr></descr>
<seealso></seealso>
</element>
<element name="TLinkListItem.ResetItem">
<short>Removes the references to the previous and next items for the list item.</short>
<descr>
<p>
<var>ResetItem</var> sets the values in the <var>Prior</var> and <var>Next</var> properties to <b>Nil</b>.
</p>
</descr>
<seealso>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
<element name="TLinkList">
<short>Defines a simple doubly linked list class.</short>
<descr>
<p>
<var>TLinkList</var> is a class which defines a navigational interface for a simple doubly linked list.
</p>
<p>
TLinkList provides properties used to access the First and Last items in the linked list, the number of list items in Count, and the first free item in the linked list. Items in the linked list are represented using the TLinkListItem class, which provides Prior and Next properties for navigation of items in the list.
</p>
<p>
TLinkList contains an abstract virtual <var>CreateItem</var> method that is used to create new items for the linked list. The method <b>must</b> be implemented in a descendent class to provided implementation details that address storage and ownership of the linked list items. See TGtkMessageQueue for an example of a concrete implementation of the TLinkList class.
</p>
</descr>
<seealso></seealso>
</element>
<element name="TLinkList.FFirstFree">
<short>First free item in the linked list.</short>
</element>
<element name="TLinkList.FFreeCount">
<short>Number of free items in the linked list.</short>
</element>
<element name="TLinkList.FFirst">
<short>First list item in the linked list.</short>
</element>
<element name="TLinkList.FLast">
<short>Last list item in the linked list.</short>
</element>
<element name="TLinkList.FCount">
<short>Number of items in the linked list.</short>
</element>
<element name="TLinkList.DisposeItem">
<short>
Removes the specified item from the linked list, and optionally frees the item instance.
</short>
<descr></descr>
<seealso></seealso>
</element>
<element name="TLinkList.DisposeItem.AnItem">
<short>List item updated in the method.</short>
</element>
<element name="TLinkList.Unbind">
<short>Removes the traversal nodes for the specified linked list item.</short>
<descr></descr>
<seealso></seealso>
</element>
<element name="TLinkList.Unbind.AnItem">
<short>Linked list item updated in the method.</short>
</element>
<element name="TLinkList.CreateItem">
<short>
Specifies the interface used to create a new linked list item for the class.
</short>
<descr>
<p>
<var>CreateItem</var> is an abstract virtual method which specifies the interface used to create a new linked list item for the class. The return value is the <var>TLinkListItem</var> class instance allocated in the method. CreateItem must be be implemented in a descendent class to handle storage and ownership for the items created in the linked list.
</p>
<p>
CreateItem is used in the implementation of the <var>GetNewItem</var> method.
</p>
</descr>
<seealso>
<link id="TLinkList.GetNewItem"/>
</seealso>
</element>
<element name="TLinkList.CreateItem.Result">
<short>New link list item allocated in the method.</short>
</element>
<element name="TLinkList.GetNewItem">
<short>
Gets a new linked list item by reusing a free item or creating a new one.
</short>
<descr>
<p>
<var>GetNewItem</var> is a <var>TLinkListItem</var> function used to get a new item for the doubly linked list. GetNewItem checks for an unused item in the linked list, and creates a new TLinkListItem instance when a free item is not found. A reused item is updated to remove the <var>Prior</var> and <var>Next</var> traversal nodes in the linked list item. A new item is retrieved by calling the CreateItem method.
</p>
</descr>
<seealso>
<link id="TLinkList.CreateItem"/>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
<element name="TLinkList.GetNewItem.Result">
<short>Linked list item reused or created in the method.</short>
</element>
<element name="TLinkList.AddAsLast">
<short>
Configures and adds the specified item as the terminal node for the doubly linked list.
</short>
<descr>
<p>
<var>AddAsLast</var> is a procedure used to make the specified list item the terminal node in the doubly linked list. AddAsLast updates the list item in <var>AnItem</var> by setting its <var>Prior</var> property to the node in <var>Last</var>. The value in its <var>Next</var> property is set to <b>Nil</b>. The updated list item is then assigned as the new value for the Last property. The value in <var>First</var> may be set to the value in AnItem when a prior node in the traversal order is not available.
</p>
<p>
AddAdLast increments the value in the Count property.
</p>
</descr>
<seealso>
<link id="TLinkList.Count"/>
<link id="TLinkList.Last"/>
<link id="TLinkList.First"/>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
<element name="TLinkList.AddAsLast.AnItem">
<short>Item saved as the last item in the linked list.</short>
</element>
<element name="TLinkList.First">
<short>First item in the doubly linked list.</short>
<descr>
<p>
<var>First</var> is a read-only <var>TLinkListItem</var> property which represents the first traversal node in the doubly linked list. The value in First is updated in methods like <var>Unbind</var> and <var>AddAsLast</var>.
</p>
</descr>
<seealso>
<link id="TLinkList.Last"/>
<link id="TLinkList.AddAsLast"/>
</seealso>
</element>
<element name="TLinkList.Last">
<short>Last item in the doubly linked list.</short>
<descr>
<p>
<var>Last</var> is a read-only <var>TLinkListItem</var> property which represents the last (or terminal) traversal node in the doubly linked list. The value in Last is updated in methods like <var>Unbind</var> and <var>AddAsLast</var>.
</p>
</descr>
<seealso>
<link id="TLinkList.AddAsLast"/>
</seealso>
</element>
<element name="TLinkList.Count">
<short>Total number of items used in the doubly linked list.</short>
<descr>
<p>
<var>Count</var> is a read-only <var>Integer</var> property which contains the number of traversal nodes in the doubly linked list. The value in Count is updated in method like <var>Unbind</var> and <var>AddAsLast</var>.
</p>
</descr>
<seealso>
<link id="TLinkList.AddAsLast"/>
</seealso>
</element>
<element name="TLinkList.Delete">
<short>Removes the specified list item from the doubly linked list.</short>
<descr>
<p>
<var>Delete</var> is a procedure used to remove the specified list item from the traversal nodes in the doubly linked list. No actions are performed in the method when <var>AnItem</var> is unassigned (contains <b>Nil</b>).
</p>
<p>
Delete calls <var>Unbind</var> to update the traversal node for the affected list items. The <var>Prior</var> and <var>Next</var> nodes in <var>AnItem</var> are set to <b>Nil</b> to remove the item from the node order. Delete decrements the value in the <var>Count</var> property.
</p>
</descr>
<seealso>
<link id="TLinkList.Count"/>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
<element name="TLinkList.Delete.AnItem">
<short>Item removed from the traversal nodes in the list.</short>
</element>
<element name="TLinkList.MoveToLast">
<short>
Relocates the specified list item to the last (or terminal) node for the linked list.
</short>
<descr>
<p>
<var>MoveToLast</var> is a procedure used to move the specified list item to the last (or terminal) node in the doubly linked list. No actions are performed in the method when <var>AnItem</var> is unassigned (contains <b>Nil</b>).
</p>
<p>
MoveToLast calls <var>Unbind</var> to ensure that AnItem is removed from the node traversal order in the linked list. MoveToLast calls <var>AddAsLast</var> to update the values in the Prior and Next properties in AnItem making it the terminal node in the traversal order.
</p>
</descr>
<seealso>
<link id="TLinkList.AddAsLast"/>
<link id="TLinkListItem.Prior"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
<element name="TLinkList.MoveToLast.AnItem">
<short>Item moved to the last node in the linked list.</short>
</element>
<element name="TLinkList.Clear">
<short>Removes all items in the doubly linked list.</short>
<descr>
<p>
<var>Clear</var> is a procedure used to remove all items in the doubly linked list. Clear uses the class instance in <var>First</var> as the initial TLinkListItem in the node traversal order. While the node is assigned, it calls the <var>Delete</var> method for each of the <var>TLinkListItem</var> instances.
</p>
</descr>
<seealso>
<link id="TLinkList.FIrst"/>
<link id="TLinkList.Delete"/>
</seealso>
</element>
<element name="TLinkList.ConsistencyCheck">
<short>
Checks the validity of traversal nodes and node counts in the doubly linked list.
</short>
<descr></descr>
<seealso></seealso>
</element>
<element name="TLinkList.ConsistencyCheck.Result">
<short>
Returns 0 when the traversal nodes and counts are valid, or a negative value an inconsistency is found.
</short>
</element>
<element name="TLinkList.Create">
<short>Constructor for the class instance.</short>
<descr>
Create calls the inherited constructor.
</descr>
<seealso></seealso>
</element>
<element name="TLinkList.Destroy">
<short>Destructor for the class instance.</short>
<descr>
<p>
<var>Destroy</var> calls <var>Clear</var>, and frees the unused items in the linked list. Destroy calls the inherited destructor prior to exiting from the method.
</p>
</descr>
<seealso>
<link id="TLinkList.Clear"/>
<link id="TLinkListItem.Next"/>
</seealso>
</element>
</module>
<!-- LazLinkedList -->
</package>
</fpdoc-descriptions>
|