Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

Interface «api::ListIterator<Type>»

List iterator interface.

public: virtual ~ListIterator();

Destructor.

public: virtual bool add(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 Type getIllegal() const;

Returns illegal element which will be returned as error value.

Returns:
illegal element.

public: virtual Type getNext();

Returns next element and advances the cursor position.

Returns:
reference to element.

public: virtual int32 getNextIndex() 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 size if the list iterator is at the end of the list.

public: virtual Type getPrevious();

Returns previous element and advances the cursor backwards.

Returns:
reference to element.

public: virtual int32 getPreviousIndex() 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 hasNext() const;

Tests if this iteration may return a next element.

Returns:
true if next element is had.

public: virtual bool hasPrevious() const;

Tests if this iteration may return a previous element.

Returns:
true if previous element is had.

public: virtual bool isConstructed() const;

Tests if this object has been constructed.

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

Tests if given value is an illegal.

Parameters:
value — testing value.

Returns:
true if value is an illegal.

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

Tests if given object has been constructed object.

public: virtual bool remove();

Removes the last element returned by this iterator.

Returns:
true if an element is removed successfully.

public: virtual void setIllegal(Type value);

Sets illegal element which will be returned as error value.

Parameters:
value — illegal value.

Back to class list