com.kamelia.sprinkler.collection.readonly.ReadOnlyIterable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of readonly-collections Show documentation
Show all versions of readonly-collections Show documentation
Sprinkler@readonly-collections | Black Kamelia
The newest version!
package com.kamelia.sprinkler.collection.readonly
/**
* Represents a read-only [Iterable]. This interface overrides the [Iterable.iterator] method to change the return type
* to a [ReadOnlyIterator] which is a read-only [Iterator].
*
* @param T the type of element being iterated over. The read-only iterable is covariant in its element type
* @see Iterable
* @see ReadOnlyIterator
*/
interface ReadOnlyIterable : Iterable {
/**
* Returns a [ReadOnlyIterator] over the elements of this object.
*
* @return a [ReadOnlyIterator] over the elements of this object
* @see Iterable.iterator
*/
override fun iterator(): ReadOnlyIterator
}