getNext

inline fun <T> Iterator<T>.getNext(defaultValue: T): T(source)

Returns the next element in this or defaultValue if the iterator is empty. The Iterables analog to this method is Iterables.getFirst.

Return

the next element of this or the default value

See also

Parameters

defaultValue

the default value to return if the iterator is empty