AbstractLinkedListSorter
Short summary
Abstract base class for LinkedListSorters. Handles the head and last properties as well as the clone.
| Access | Abstract | Final | Extends | Implements |
|---|---|---|---|---|
| INTERNAL | Yes | No | AbstractListSorter | CNM_CollectionInterfaces.ILinkedListSorter |
UML Diagram
Parameters
none
Methods
instantInverseSort
- Parameters:
size(UDINT): The size of the list to be sortedcomparator(CNM_CollectionInterfaces.CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in processhead(CNM_CollectionInterfaces.IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.last(CNM_CollectionInterfaces.IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structurescurrentListVersion(__XWORD): the current version of the list, must change when the data in the list changes
- Return type: CNM_CollectionInterfaces.CNM_ReturnTypes.SingleExecutionResult
This method sorts the data structure instantly in descending order within one call. …
inverseSort
- Parameters:
execute(BOOL): control bit to start or abort the inverting, needs to be active until the ExecutionState is noz longer busysize(UDINT): The size of the list to be sortedcomparator(CNM_AbstractObject.IComparator): the comparator that should be used for the sort. Must not be changed while sort is in processhead(CNM_CollectionInterfaces.IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.last(CNM_CollectionInterfaces.IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structurescurrentListVersion(__XWORD): the current version of the list, must change when the data in the list changes
- Return type: CNM_ReturnTypes.SingleExecutionState
This method sorts the Sortable in the inverted order, so from great to low…
Abstract methods
instantSort
- Parameters:
size(UDINT): The size of the list to be sortedcomparator(CNM_CollectionInterfaces.CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in processhead(CNM_CollectionInterfaces.IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.last(CNM_CollectionInterfaces.IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structurescurrentListVersion(__XWORD): the current version of the list, must change when the data in the list changes
- Return type: CNM_CollectionInterfaces.CNM_ReturnTypes.SingleExecutionResult
This method sorts the data structure instantly within one call. …
sort
- Parameters:
head(CNM_CollectionInterfaces.IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.last(CNM_CollectionInterfaces.IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structurescurrentListVersion(__XWORD): the current version of the list, must change when the data in the list changesexecute(BOOL): control bit to start or abort the sorting, needs to be active until the ExecutionState is SUCCESSsize(UDINT): The size of the list to be sortedcomparator(CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in process
- Return type: CNM_ReturnTypes.SingleExecutionState
This method sorts the data structure. …
Code
Declaration
FUNCTION_BLOCK INTERNAL ABSTRACT AbstractLinkedListSorter EXTENDS AbstractListSorter IMPLEMENTS CNM_CollectionInterfaces.ILinkedListSorter
VAR
sorterHead :CNM_CollectionInterfaces.IDoublyLinkedElement;
sorterLast :CNM_CollectionInterfaces.IDoublyLinkedElement;
END_VAR