classwork.ppIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers Classes hierarchy graph
|
Class APointerListItem
Unit
classwork
Declaration
type APointerListItem = class(ANode)
Description
This class represents a single entry in APointerList. It extends ANode to allow each one to hold a pointer value. The list item also supports streaming.
Hierarchy
Overview
Fields
Methods
Description
Fields
|
myReference: pointer; |
Stores the value of the list item.
|
Methods
|
constructor withReference(const thisReference: pointer); virtual; |
Construct a new list item that has the specified pointer value.
|
|
function init: boolean; override; |
Initializer
|
|
function Find(const thisReference: pointer): APointerListItem; virtual; |
Search the node, its children, and its older siblings for the specified value.
This method performs a sequential search through each node and so can be inefficient for large lists. It begins by recursively calling itself on any older siblings. If the value is not found, then it searches the current node and its children.
If this method is called on the last item in APointerList, it will result in the entire list being searched.
Returns
A reference to the first node that contains the specified pointer value, if found; Nil if the value was not found. |
|
function shallowCopyFrom(const Other: AnObject): boolean; override; |
Construct a shallow copy of the other object.
This method overrides the behavior inherited from AnObject.shallowCopyFrom: it calls that method, then checks to see whether Other is an instance of APointerListItem. If so, it copies the value of APointerListItem.reference from Other to Self , overwriting the value in Self .
Note that this method does NOT copy any sibling or child nodes and so cannot be used to create a full copy of any descendant of ANode. The copy will NOT be automatically placed in the list to which Other belongs, if any, but the caller is free to do so.
|
|
function selfStreamingLength: TStreamIOSize; override; |
Calculate the number of bytes required to stream the node, and just the node.
This method builds upon the behavior inherited from ANode.selfStreamingLength: it calls the inherited routine, then calculates the number of bytes required to stream its text and adds that to the result, which is returned to the caller.
|
|
function writeSelfTo(const Dest: AStream): TStreamIOSize; override; |
Write the node, and just the node, to the specified stream. For more information on this method, see ANode.writeSelfTo.
This writes the value of its reference, then calls the inherited routine.
Returns
The total number of bytes written to Dest . |
|
function readFrom(const Source: AStream): TStreamIOSize; override; |
Read the node from the specified stream. For more information on this method, see ANode.readFrom.
This method reads the value of its pointer reference, then calls the inherited routine.
Returns
The total number of bytes read from Source . |
|
function reference: pointer; virtual; |
Retrieve the pointer value associated with the node.
|
|
function setReference(const newReference: pointer): pointer; |
Set the pointer value associated with the node.
Returns
The old pointer value associated with the node. |
Generated by PasDoc 0.13.0 on 2015-06-23 19:40:11
|