limit
Returns a view of this containing its first limitSize elements. If this contains fewer than limitSize elements, the returned view contains all of its elements. The returned iterable's iterator supports remove() if this's iterator does.
Stream equivalent: Stream.limit
See also
Parameters
the maximum number of elements in the returned iterable
Throws
if limitSize is negative
Returns a view containing the first limitSize elements of this. If this contains fewer than limitSize elements, the returned view contains all of its elements.
See also
Parameters
the maximum number of elements in the returned iterator
Throws
if limitSize is negative
Returns a view containing the first limitSize elements of this. If this contains fewer than limitSize elements, the returned view contains all of its elements. The returned iterator supports remove() if iterator does.
See also
Parameters
the maximum number of elements in the returned iterator
Throws
if limitSize is negative