TList: Methods Functions  


Methods

ClearClear a linked list
IsEmptyCheck if list is empty
ContainsCheck if list contains a value
AddFirstAdd an object to the start of the list
AddLastAdd an object to the end of the list
FirstReturns the first object in the list
LastReturns the last object in the list
RemoveFirstRemoves and returns the first object in the list.
RemoveLastRemoves and returns the last object in the list.
FirstLinkReturns the first link the list or null if the list is empty.
LastLinkReturns the last link the list or null if the list is empty.
InsertBeforeLinkInserts an object before the specified list link.
InsertAfterLinkInserts an object after the specified list link.
FindLinkReturns the first link in the list with the given value, or null if none found.
ValueAtIndexReturns the value of the link at the given index.
CountCount list length
RemoveRemove an object from a linked list
SwapSwap contents with the list specified.
CopyCreates an identical copy of the list.
ReverseReverse the order of the list.
ReversedCreates a new list that is the reversed version of this list.
SortSort a list in either ascending (default) or decending order.
ToArrayconvert a list to an array

Functions

FromArrayCreate a list from an array

Method reference

Method Clear()
DescriptionClear a linked list
InformationRemoves all objects from list.

Method IsEmpty()
ReturnsTrue if list is empty, else false
DescriptionCheck if list is empty

Method Contains( value:Object )
ReturnsTrue if list contains value, else false
DescriptionCheck if list contains a value

Method AddFirst:TLink( value:Object )
ReturnsA link object
DescriptionAdd an object to the start of the list

Method AddLast:TLink( value:Object )
ReturnsA link object
DescriptionAdd an object to the end of the list

Method First:Object()
DescriptionReturns the first object in the list
InformationReturns Null if the list is empty.

Method Last:Object()
DescriptionReturns the last object in the list
InformationReturns Null if the list is empty.

Method RemoveFirst:Object()
DescriptionRemoves and returns the first object in the list.
InformationReturns Null if the list is empty.

Method RemoveLast:Object()
DescriptionRemoves and returns the last object in the list.
InformationReturns Null if the list is empty.

Method FirstLink:TLink()
DescriptionReturns the first link the list or null if the list is empty.

Method LastLink:TLink()
DescriptionReturns the last link the list or null if the list is empty.

Method InsertBeforeLink:TLink( value:Object,succ:TLink )
DescriptionInserts an object before the specified list link.

Method InsertAfterLink:TLink( value:Object,pred:TLink )
DescriptionInserts an object after the specified list link.

Method FindLink:TLink( value:Object )
DescriptionReturns the first link in the list with the given value, or null if none found.

Method ValueAtIndex:Object( index )
DescriptionReturns the value of the link at the given index.
InformationThrows an exception if the index is out of range (must be 0..list.Count()-1 inclusive).

Method Count()
ReturnsThe numbers of objects in list.
DescriptionCount list length

Method Remove( value:Object )
DescriptionRemove an object from a linked list
InformationRemove scans a list for the specified value and removes its link.

Method Swap( list:TList )
DescriptionSwap contents with the list specified.

Method Copy:TList()
DescriptionCreates an identical copy of the list.

Method Reverse()
DescriptionReverse the order of the list.

Method Reversed:TList()
DescriptionCreates a new list that is the reversed version of this list.

Method Sort( ascending=True,compareFunc( o1:Object,o2:Object ) )
DescriptionSort a list in either ascending (default) or decending order.
InformationUser types should implement a Compare method in order to be sorted.

Method ToArray:Object[]()
ReturnsAn array of objects
Descriptionconvert a list to an array

Function reference

Function FromArray:TList( arr:Object[] )
ReturnsA new linked list
DescriptionCreate a list from an array