Class Sequences


  • public class Sequences
    extends Object
    • Constructor Detail

      • Sequences

        public Sequences()
    • Method Detail

      • empty

        public static <T> Sequence<T> empty()
      • map

        public static <From,​To> Sequence<To> map​(Sequence<From> sequence,
                                                       com.google.common.base.Function<? super From,​? extends To> fn)
      • filter

        public static <T> Sequence<T> filter​(Sequence<T> sequence,
                                             com.google.common.base.Predicate<? super T> pred)
      • wrap

        public static <T> Sequence<T> wrap​(Sequence<T> seq,
                                           SequenceWrapper wrapper)
        Allows to execute something before, after or around the processing of the given sequence. See documentation to SequenceWrapper methods for some details.
      • sort

        public static <T> Sequence<T> sort​(Sequence<T> sequence,
                                           Comparator<T> comparator)
        Returns a sorted copy of the provided sequence. This will materialize the entire sequence in memory. Use at your own risk. The sort is stable, meaning that equal elements (as determined by the comparator) will not be reordered.