Ignore:
Timestamp:
2020-01-19T18:57:26+01:00 (4 years ago)
Author:
simon04
Message:

see #18503 - Relation editor: compute wayConnection for type=superroute

This basic implementation only considers route segments without a role
(as specified for public_transport:version=2; no forward/backward)
and does not take roundabouts into account.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/StreamUtils.java

    r11921 r15732  
    22package org.openstreetmap.josm.tools;
    33
     4import java.util.List;
     5import java.util.Objects;
    46import java.util.StringJoiner;
    57import java.util.stream.Collector;
     8import java.util.stream.IntStream;
    69import java.util.stream.Stream;
    710import java.util.stream.StreamSupport;
     
    3235
    3336    /**
     37     * Creqates a stream iterating the list in reversed order
     38     * @param list the list to iterate over
     39     * @param <T> the type of elements in the list
     40     * @return a stream iterating the list in reversed order
     41     * @since 15732
     42     */
     43    public static <T> Stream<T> reversedStream(List<T> list) {
     44        Objects.requireNonNull(list, "list");
     45        final int size = list.size();
     46        return IntStream.range(0, size).mapToObj(i -> list.get(size - i - 1));
     47    }
     48
     49    /**
    3450     * Creates a new Collector that collects the items and returns them as HTML unordered list.
    3551     * @return The collector.
Note: See TracChangeset for help on using the changeset viewer.