-
-
Notifications
You must be signed in to change notification settings - Fork 0
CountableFilterIterator
Provides a filter iterator implementation that is also countable.
This abstract class SHALL extend
- See: \FilterIterator so that concrete implementations MAY filter elements from an inner iterator while also exposing count semantics. The counting behavior MUST be provided through the composed trait and SHALL operate according to the characteristics of the wrapped inner iterator. Implementations SHOULD ensure that their filtering logic remains consistent with the sequence being counted.
- Full name:
\FastForward\Iterator\CountableFilterIterator - Parent class:
FilterIterator - This class implements:
Countable - This class is an Abstract class
Counts the number of elements exposed by the inner iterator.
public count(): intIf the inner iterator implements
-
See: \Countable, this method SHALL return the value provided by that implementation. Otherwise, it MUST count elements by iterating over the iterator. If the inner iterator is not cloneable, this method SHALL wrap the current object in an
-
See: \IteratorIterator instance and count through that wrapper to avoid performing an invalid clone operation. If the inner iterator is cloneable, this method SHOULD count over a clone so that the original iterator state is preserved as much as possible.
Return Value:
the total number of elements available from the inner iterator