Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Interface «api::ListIterator<Type>»

List iterator interface.

Parameters:
Type — data type of list iterator element.

public: virtual ~ListIterator();

Destructor.

public: virtual bool add(const Type& element);

Inserts the specified element into the list.

Method inserts given element before the element that will be returned by next method. Therefore subsequent call to next will be unaffected, and a subsequent call to prev will return the inserted element.

Parameters:
element — inserting element.

Returns:
true if element is added.

public: virtual bool hasNext() const;

Tests if this iteration may return a next element.

Returns:
true if next element is had.

public: virtual bool hasPrev() const;

Tests if this iteration may return a previous element.

Returns:
true if previous element is had.

public: virtual Type illegal() const;

Returns illegal element which will be returned as error value.

Returns:
illegal element.

public: virtual void illegal(const Type value);

Sets illegal element which will be returned as error value.

Parameters:
value — illegal value.

public: virtual bool isConstructed() const;

Tests if this object has been constructed.

Returns:
true if object has been constructed successfully.

public: virtual bool isIllegal(const Type& value) const;

Tests if given value is an illegal.

Parameters:
value — testing value.
true — if value is an illegal.

public: static bool isObject(const Type* obj);

Tests if given object has been constructed object.

Parameters:
obj — pointer to object.

Returns:
true if object has been constructed successfully.

public: virtual Type next();

Returns next element and advances the cursor position.

Returns:
reference to element.

public: virtual int32 nextIndex() const;

Returns the index of the element that would be returned by a subsequent call to next().

Returns:
index of the next element or list sizeif the list iterator is at the end of the list.

public: virtual Type prev();

Returns previous element and advances the cursor backwards.

Returns:
reference to element.

public: virtual int32 prevIndex() const;

Returns the index of the element that would be returned by a subsequent call to prev().

Returns:
index of the previous element or -1 if the list iterator is at the beginning of the list.

public: virtual bool remove();

Removes the last element returned by this iterator.

Returns:
true if an element is removed successfully.

Back to class list