File tree Expand file tree Collapse file tree
microsphere-java-core/src/main/java/io/microsphere/collection Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717package io .microsphere .collection ;
1818
1919/**
20- * Empty {@link Iterable}
20+ * An empty {@link Iterable} implementation that always returns an empty iterator.
21+ * <p>
22+ * This class is a singleton-friendly extension of {@link IterableAdapter}, primarily useful for representing
23+ * an empty collection view. It guarantees that the method {@link #iterator()} will return an instance of
24+ * {@link EmptyIterator#INSTANCE}, ensuring consistent behavior across uses.
25+ * </p>
2126 *
22- * @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
27+ * <h3>Example Usage</h3>
28+ * <pre>{@code
29+ * Iterable<String> emptyIterable = EmptyIterable.INSTANCE;
30+ * for (String item : emptyIterable) {
31+ * // This loop will not execute as the iterable is empty.
32+ * }
33+ * }</pre>
34+ *
35+ * @param <E> the type of elements returned by the iterator
36+ * @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
2337 * @see Iterable
2438 * @see EmptyIterator
2539 * @since 1.0.0
You can’t perform that action at this time.
0 commit comments