abstract class $FILTERS {ETP, CTP < $ELT{ETP}} is
-- This abstraction models a container for which quantifiers are
-- provided and for which sequences of elements satisfying some particular
-- predicate may be retrieved.
count_if(
predicate : ROUT{ETP} : BOOL
) : CARD ;
-- This routine returns the number of elements of self which satisfy
-- the given predicate.
exists(
predicate : ROUT{ETP} : BOOL
) : BOOL ;
-- This predicate returns true if and only if an element of self
-- which satisfies the predicate test exists.
exists(
predicate : ROUT{ETP} : BOOL,
out res : ETP
) : BOOL ;
-- This routine returns true if and only if self has at least one
-- element that satisfies the predicate. The out argument 'res' is set to
-- have the element value concerned if true is returned.
not_exists(
predicate : ROUT{ETP} : BOOL
) : BOOL ;
-- This predicate returns true if and only if no element of self
-- satisfies the given predicate.
every(
predicate : ROUT{ETP} : BOOL
) : BOOL ;
-- This predicate returns true if and only if every element of self
-- satisfies the given predicate.
not_every(
predicate : ROUT{ETP} :BOOL
) : BOOL ;
-- This predicate returns true if at least one element of self fails
-- the given predicate.
unique! : ETP ;
-- This iter yields in turn all of the elements of the given container
-- which are unique.
filter!(
once predicate : ROUT{ETP} : BOOL
) : ETP ;
-- This iter yields in turn all of the elements which satisfy the given
-- predicate.
not_filter!(
once predicate : ROUT{ETP} : BOOL
) : ETP ;
-- This iter yields in turn all of the elements which do NOT satisfy
-- the given predicate.