Skip to main content

AbstractArrayListSorter

Short summary

The abstract implementation of an ArrayListSorter, to provide default implementations for setting comparator, the IObject methods. Provides the default implementation for sort and inverseSort.

AccessAbstractFinalExtendsImplements
INTERNALYesNoAbstractListSorterCNM_CollectionInterfaces.IArrayListSorter

UML Diagram

Methods

instantInverseSort

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 busy
    • size (UDINT): The size of the list to be sorted
    • container (POINTER TO CNM_AbstractObject.IObject): the container, that contains the list elements
    • comparator (CNM_AbstractObject.IComparator): the comparator that should be used for the sort. Must not be changed while sort is in process
    • 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 Sortable in the inverted order, so from great to low

Abstract methods

instantSort

This method sorts the data structure instantly within one call.

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
    • container (POINTER TO CNM_AbstractObject.IObject): the container, that contains the list elements
    • comparator (CNM_AbstractObject.IComparator): the comparator that should be used for the sort. Must not be changed while sort is in process
    • 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

FUNCTION_BLOCK INTERNAL ABSTRACT AbstractArrayListSorter EXTENDS AbstractListSorter IMPLEMENTS CNM_CollectionInterfaces.IArrayListSorter