Skip to main content

AbstractArrayListIterator

Short summary

An abstract class to implement the basic datastructure dependency to array lists.

AccessAbstractFinalExtendsImplements
YesNoAbstractIteratorIArrayListIterator

UML Diagram

Parameters

none

Methods

attachArrayList

  • Parameters:
    • list (REFERENCE TO ArrayList): The list to be attached. Should be a reference of type ArrayList
  • Return type: VOID

This method attaches an array list to the iterator.

FB_init

  • Parameters:
    • bInitRetains (BOOL): if TRUE, the retain variables are initialized (warm start / cold start)
    • bInCopyCode (BOOL): if TRUE, the instance afterwards gets moved into the copy code (online change)
    • arrayList (REFERENCE TO ArrayList): the array list which should be iterated, can be 0
  • Return type: BOOL

The constructor FB_init is needed to create an unique hash code.

hasNext

  • Return type: BOOL

This method returns if there exists another element to iterate to.

iterate

This method returns the next object in the iteration and returns an execution state.

reset

  • Return type: VOID

This method resets the iterator.

Code

Declaration

FUNCTION_BLOCK ABSTRACT AbstractArrayListIterator EXTENDS AbstractIterator IMPLEMENTS IArrayListIterator
VAR
{attribute 'hide'}
list :REFERENCE TO ArrayList;
nextIndex :__XWORD;
direction :IterationDirection;
END_VAR