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

Java Conceptuel Diagram

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

Enumerable data type

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

toStream

Java - Stream Processing

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()));





Discover More
Java Collection Type
Java - (Collection|container) Framework (Types)

A collection (known also as a container) is an object that groups multiple objects (elements) into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. ...
Java Conceptuel Diagram
Java - Iterator Implementation

The iterator implementation in Java is just an inner class that implements the iterator interface. In order to be able to use it in a for loop construction, the iterable interface must be implemented....



Share this page:
Follow us:
Task Runner