LisaacTM Platform

TRAVERSABLE


A `TRAVERSABLE(E_)' is a finite readable sequence of objects of type E_.
For instance, `COLLECTION's and `STRING's are `TRAVERSABLE'.
A good performance should always be obtained by sequentially acessing a `TRAVERSABLE' with increasing indexes (from `lower' to `upper'), as demonstrated in the following code snippet :
i := a_traversable.lower; {i > a_traversable.upper}.until_do { do_something_with (a_traversable.item i); i := i + 1; };
Other accessing methods (including random access and sequential access from `upper' to `lower') may or may not lead to acceptable performance, depending on the particular implementation of `TRAVERSABLE'.
Inherit/Insert Summary
parent_object No developed.
 
Indexing:
lower
Minimum index.
See also upper, valid_index, item.
upper
Maximum index.
See also lower, valid_index, item.
valid_index
True when i is valid (i.e., inside actual bounds).
See also lower, upper, item.
 
Counting:
count
Number of available indices.
See also is_empty, lower, upper.
is_empty
Is collection empty ?
See also count.
 
Accessing:
item
Item at the corresponding index i.
See also lower, upper, valid_index.
first
The very first item.
See also last, item.
last
The last item.
See also first, item.
 
Iterate:
iterate
iterate_index
iterate_increment
iterate_index increment
iterate_reverse
 

Inherit/Insert Detail

parent_object

.../base/property/traversable.li line #28

Section:
Inherit

Profile:
- SelfSELFparent_object : OBJECT

Indexing:

lower

.../base/property/traversable.li line #36

Section:
Public

Profile:
- SelfSELFlower : INTEGER

Description:
Minimum index.
See also upper, valid_index, item.

upper

.../base/property/traversable.li line #45

Section:
Public

Profile:
- SelfSELFupper : INTEGER

Description:
Maximum index.
See also lower, valid_index, item.

valid_index

.../base/property/traversable.li line #54

Section:
Public

Profile:
- SelfSELFvalid_index   i : INTEGERBOOLEAN

Description:
True when i is valid (i.e., inside actual bounds).
See also lower, upper, item.

Counting:

count

.../base/property/traversable.li line #69

Section:
Public

Profile:
- SelfSELFcount : INTEGER

Description:
Number of available indices.
See also is_empty, lower, upper.

is_empty

.../base/property/traversable.li line #81

Section:
Public

Profile:
- SelfSELFis_empty : BOOLEAN

Description:
Is collection empty ?
See also count.

Accessing:

item

.../base/property/traversable.li line #96

Section:
Public

Profile:
- SelfSELFitem   i : INTEGERV

Description:
Item at the corresponding index i.
See also lower, upper, valid_index.

first

.../base/property/traversable.li line #108

Section:
Public

Profile:
- SelfSELFfirst : V

Description:
The very first item.
See also last, item.

last

.../base/property/traversable.li line #122

Section:
Public

Profile:
- SelfSELFlast : V

Description:
The last item.
See also first, item.

Iterate:

iterate

.../base/property/traversable.li line #140

Section:
Public

Profile:
- SelfSELFiterate : ITERATORV)

iterate_index

.../base/property/traversable.li line #142

Section:
Public

Profile:
- SelfSELFiterate_index   idx : INTEGERITERATORV)

iterate_increment

.../base/property/traversable.li line #145

Section:
Public

Profile:
- SelfSELFiterate_increment   inc : INTEGERITERATORV)

iterate_index increment

.../base/property/traversable.li line #148

Section:
Public

Profile:
- SelfSELFiterate_index   idx : INTEGER  increment   inc : INTEGERITERATORV)

iterate_reverse

.../base/property/traversable.li line #151

Section:
Public

Profile:
- SelfSELFiterate_reverse : ITERATORV)