of_iterator


Description:

public static Seq<G> of_iterator<G> (Iterator<G> iterator, int64 estimated_size, bool size_known, TaskEnv? env = null)

Creates a new sequential seq of the given iterator.

Most of the seq operations affect the state of the given iterator by moving it forward. and the iterator must not be modified until the execution of the seq pipeline is completed. Except for the non-eager operations iterator() and spliterator(), execution is performed when the terminal operation is invoked. In case of the non-eager operations, the iterator must not be modified while the result iterator/spliterator is used.

Parameters:

iterator

an iterator

estimated_size

an estimate of the number of elements

size_known

whether or not the estimated_size is an accurate size

env

a task environment. If not specified, TaskEnv.get_common_task_env is used.

Returns:

the result seq