Example usage for java.util LinkedList parallelStream

List of usage examples for java.util LinkedList parallelStream

Introduction

In this page you can find the example usage for java.util LinkedList parallelStream.

Prototype

default Stream<E> parallelStream() 

Source Link

Document

Returns a possibly parallel Stream with this collection as its source.

Usage

From source file:org.kitodo.dataformat.access.MetsXmlElementAccess.java

/**
 * Creates the struct link section. The struct link section stores which
 * files are attached to which nodes and leaves of the description
 * structure.// w w  w. j  a va2s  . c  om
 * 
 * @param smLinkData
 *            The list of related IDs
 * @return the struct link section
 */
private StructLink createStructLink(LinkedList<Pair<String, String>> smLinkData) {
    StructLink structLink = new StructLink();
    structLink.getSmLinkOrSmLinkGrp().addAll(smLinkData.parallelStream().map(entry -> {
        SmLink smLink = new SmLink();
        smLink.setFrom(entry.getLeft());
        smLink.setTo(entry.getRight());
        return smLink;
    }).collect(Collectors.toList()));
    return structLink;
}