forArray

inline fun <T> forArray(vararg array: T): Iterator<T>(source)

Returns an iterator containing the elements of array in order. The returned iterator is a view of the array; subsequent changes to the array will be reflected in the iterator.

Note: It is often preferable to represent your data using a collection type, for example using Arrays.asList, making this method unnecessary.

The Iterable equivalent of this method is either Arrays.asList, ImmutableList.copyOf}, or ImmutableList.of.

See also