About
The (Enumeration|Iterator) interface defines the methods by which you can:
- enumerate
- obtain one at a time
the elements of a collection.
The Enumerator Interface:
- has been deprecated for the use of Iterator.
- is an external iterators
Articles Related
Enumerable data type
Enumerable types are class that implement the enum or iterable interface such as:
- all collection,
- and Java arrays
toStream
StreamSupport.stream(iterable.spliterator(), false/true)
Example:
- Does a string starts with a root directory ?
String s = "c:\";
Boolean isAbsolutePath = StreamSupport
.stream(fileSystem.getRootDirectories().spliterator(), false)
.anyMatch(p->s.startsWith(p.toString()));