Iterable subinterface that supports peeking the first element, and checking if it is empty.
The purpose of this interface is to be able to query some information without the need of creating a new Iterator.
TThe element type.
public boolean | isEmpty() Checks if the iterable is empty. |
public T | peek() Gets the first element in this iterable, or null if there's none. |
From: Iterable< |
Checks if the iterable is empty.
If it is empty, peek() will return null
, and any iterators created will have no next
elements.
true
if the iterable contains no elements.