+
Point of view
All features
deferred class BIDIRECTIONAL_ITERATOR [E_]
Summary
An iterator that allows to traverse a COLLECTION forward and backward. Those COLLECTIONs can be iterated back and forth even if its items are not COMPARABLE. For example a two-way list of three-dimensional points may while the points are not naturally ordered.
Direct parents
Inherit list: ITERATOR
Class invariant
Overview
Features
{ANY}
  • finish
    Positions the iterator to the last object in the aggregate to be traversed.
  • previous
    Positions the iterator to the previous object in the sequence.
{ANY}
  • is_valid: BOOLEAN
  • start
    Positions the iterator to the first object in the aggregate to be traversed.
  • is_off: BOOLEAN
    Returns True when there are no more objects in the sequence.
  • item: E_
    Returns the object at the current position in the sequence.
  • next
    Positions the iterator to the next object in the sequence.
Check that the underlying traversable has not changed
{ANY}
Agent-based features:
{ANY}
Invariant on generation` dynamics
{}
finish
deferred procedure
{ANY}
Positions the iterator to the last object in the aggregate to be traversed.
ensure
previous
deferred procedure
{ANY}
Positions the iterator to the previous object in the sequence.
require
is_valid: BOOLEAN
frozen
effective function
{ANY}
start
deferred procedure
{ANY}
Positions the iterator to the first object in the aggregate to be traversed.
ensure
is_off: BOOLEAN
deferred function
{ANY}
Returns True when there are no more objects in the sequence.
require ensure
item: E_
deferred function
{ANY}
Returns the object at the current position in the sequence.
require ensure
next
deferred procedure
{ANY}
Positions the iterator to the next object in the sequence.
require ensure
iterable_generation: INTEGER_32
deferred function
{ANY}
generation: INTEGER_32
deferred function
{ANY}
for_each (action: PROCEDURE[TUPLE[TUPLE 1[E_]]])
effective procedure
{ANY}
Apply action to every item of Current.
See also for_all, exists, aggregate.
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Do all items satisfy test?
See also for_each, exists, aggregate.
exists (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Does at least one item satisfy test?
See also for_each, for_all, aggregate.
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
{ANY}
Aggregate all the elements starting from the initial value.
See also for_each, for_all, exists.
generation_for_invariant: INTEGER_32
writable attribute
{}
generation_only_grows: BOOLEAN
effective function
{}