GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
HOARD
+
Point of view
All features
ANY
All features
deferred class HOARD [E_]
Summary
top
A hoard of objects is a collation of many objects sharing the same type. This meta type defines some traversal features using agents, as well as very simple hoard properties:
count
and
is_empty
.
Direct parents
Insert list:
ANY
Known children
Inherit list:
INDEXABLE
,
ITERABLE
Overview
top
Features
Counting:
{
ANY
}
count
:
INTEGER_32
Number of available items in the hoard.
is_empty
:
BOOLEAN
Is the hoard empty ?
See also
count
.
Agent-based features:
{
ANY
}
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
Apply
action
to every item of
Current
.
do_all
(action:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]])
Apply
action
to every item of
Current
.
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Do all items satisfy
test
?
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
Does at least one item satisfy
test
?
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
Aggregate all the elements starting from the initial value.
{}
_inline_agent1
(a:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]], e: E_)
count
:
INTEGER_32
deferred function
{
ANY
}
top
Number of available items in the hoard.
See also
is_empty
ensure
Result >= 0
is_empty
:
BOOLEAN
deferred function
{
ANY
}
top
Is the hoard empty ?
See also
count
.
ensure
definition:
Result =
count
= 0
for_each
(action:
PROCEDURE
[
TUPLE
[TUPLE 1[E_]]])
deferred procedure
{
ANY
}
top
Apply
action
to every item of
Current
.
See also
for_all
,
exists
,
aggregate
.
require
action /= Void
do_all
(action:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]])
frozen
effective procedure
{
ANY
}
top
Apply
action
to every item of
Current
.
This feature is obsolete:
Use `for_each` instead. This feature is not secure because it accepts a FUNCTION, the result of which is lost.
for_all
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
deferred function
{
ANY
}
top
Do all items satisfy
test
?
See also
for_each
,
exists
,
aggregate
.
require
test /= Void
exists
(test:
FUNCTION
[
TUPLE
[TUPLE 1[E_]]]):
BOOLEAN
deferred function
{
ANY
}
top
Does at least one item satisfy
test
?
See also
for_each
,
for_all
,
aggregate
.
require
test /= Void
aggregate
(action:
FUNCTION
[
TUPLE
[TUPLE 2[E_, E_], E_]], initial: E_): E_
deferred function
{
ANY
}
top
Aggregate all the elements starting from the initial value.
See also
for_each
,
for_all
,
exists
.
require
action /= Void
_inline_agent1
(a:
ROUTINE
[
TUPLE
[TUPLE 1[E_]]], e: E_)
frozen
effective procedure
{}
top