O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The main element of this example is Spliterator. This interface defines methods that can be used to process and partition a source of elements to be used, for example, the source of a Stream object. You will rarely need to use a Spliterator object directly. Only if you want a different behavior--that is, if you want to implement your own data structure and create Stream from it--use a Spliterator object.

Spliterator has a set of characteristics that defines its behavior. They are as follows:

  • CONCURRENT: The data source can be safely modified concurrently
  • DISTINCT: All the elements of the data source are distinct
  • IMMUTABLE: Elements can be added, deleted, or replaced in the data source
  • NONNULL: There's no null element in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required