Sdílet prostřednictvím


Collections.EmptyIterator Method

Definition

Returns an iterator that has no elements.

[Android.Runtime.Register("emptyIterator", "()Ljava/util/Iterator;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.IIterator EmptyIterator ();
[<Android.Runtime.Register("emptyIterator", "()Ljava/util/Iterator;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member EmptyIterator : unit -> Java.Util.IIterator

Returns

an empty iterator

Attributes

Remarks

Returns an iterator that has no elements. More precisely,

<ul> <li>Iterator#hasNext hasNext always returns false.</li> <li>Iterator#next next always throws NoSuchElementException.</li> <li>Iterator#remove remove always throws IllegalStateException.</li> </ul>

Implementations of this method are permitted, but not required, to return the same object from multiple invocations.

Added in 1.7.

Java documentation for java.util.Collections.emptyIterator().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to