Table of Contents

Java - (Enumerable|Iterator) Data Type (Iterable interface)

About

The (Enumeration|Iterator) interface defines the methods by which you can:

the elements of a collection.

The Enumerator Interface:

Enumerable data type

Enumerable types are class that implement the enum or iterable interface such as:

toStream

Stream

StreamSupport.stream(iterable.spliterator(), false/true)

Example:

String s = "c:\";
Boolean isAbsolutePath = StreamSupport
      .stream(fileSystem.getRootDirectories().spliterator(), false)
      .anyMatch(p->s.startsWith(p.toString()));