All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kamelia.sprinkler.collection.readonly.ReadOnlyIterable.kt Maven / Gradle / Ivy

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy