List of usage examples for java.util LinkedList parallelStream
default Stream<E> parallelStream()
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; }