Skip to main content

ILinkedListSorter

Short summary

Interface for sorter of LinkedList classes.

AccessAbstractFinalExtendsImplements
-NoNoIListSorter-

UML Diagram

Methods

instantInverseSort

  • Parameters:
    • size (UDINT): The size of the list to be sorted
    • comparator (CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in process
    • head (IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.
    • last (IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structures
    • currentListVersion (__XWORD): the current version of the list, must change when the data in the list changes
  • Return type: CNM_ReturnTypes.SingleExecutionResult

This method sorts the data structure instantly in descending order within one call.

instantSort

  • Parameters:
    • size (UDINT): The size of the list to be sorted
    • comparator (CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in process
    • head (IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.
    • last (IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structures
    • currentListVersion (__XWORD): the current version of the list, must change when the data in the list changes
  • Return type: CNM_ReturnTypes.SingleExecutionResult

This method sorts the data structure instantly within one call.

inverseSort

  • Parameters:
    • execute (BOOL): control bit to start or abort the inverting
    • size (UDINT): The size of the list to be sorted
    • comparator (CNM_AbstractObject.IComparator): the comparator that should be used for the sort. Must not be changed while sort is in process
    • head (IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.
    • last (IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structures
    • currentListVersion (__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 LinkedList in the inverted order, so from greatest to smallest.

sort

  • Parameters:
    • execute (BOOL): control bit to start or abort the sorting, needs to be active until the ExecutionState is SUCCESS
    • size (UDINT): The size of the list to be sorted
    • comparator (CNM_AbstractObject.IComparator): Optional: the comparator that should be used for the sort. Must not be changed while sort is in process
    • head (IDoublyLinkedElement): The first element in the list, must be set on every call to current head of list.
    • last (IDoublyLinkedElement): The last element of the list after sorting, may be useful for doublelinked structures
    • currentListVersion (__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 data structure.

Code

Declaration

INTERFACE ILinkedListSorter EXTENDS IListSorter