Klasse DoubleIterables

java.lang.Object
speiger.src.collections.doubles.utils.DoubleIterables

public class DoubleIterables extends Object
A Helper class for Iterables
  • Konstruktordetails

    • DoubleIterables

      public DoubleIterables()
  • Methodendetails

    • map

      public static <E> ObjectIterable<E> map(Iterable<? extends Double> iterable, DoubleFunction<E> mapper)
      A Helper function that maps a Java-Iterable into a new Type.
      Typparameter:
      E - The return type.
      Parameter:
      iterable - the iterable that should be mapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is mapped to a new result
    • map

      public static <E> ObjectIterable<E> map(DoubleIterable iterable, DoubleFunction<E> mapper)
      A Helper function that maps a Iterable into a new Type.
      Typparameter:
      E - The return type.
      Parameter:
      iterable - the iterable that should be mapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is mapped to a new result
    • flatMap

      public static <E, V extends Iterable<E>> ObjectIterable<E> flatMap(Iterable<? extends Double> iterable, DoubleFunction<V> mapper)
      A Helper function that flatMaps a Java-Iterable into a new Type.
      Typparameter:
      E - The return type.
      V - The return type supplier.
      Parameter:
      iterable - the iterable that should be flatMapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is flatMapped to a new result
    • flatMap

      public static <E, V extends Iterable<E>> ObjectIterable<E> flatMap(DoubleIterable iterable, DoubleFunction<V> mapper)
      A Helper function that flatMaps a Iterable into a new Type.
      Typparameter:
      E - The return type.
      V - The return type supplier.
      Parameter:
      iterable - the iterable that should be flatMapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is flatMapped to a new result
    • arrayFlatMap

      public static <E> ObjectIterable<E> arrayFlatMap(Iterable<? extends Double> iterable, DoubleFunction<E[]> mapper)
      A Helper function that flatMaps a Java-Iterable into a new Type.
      Typparameter:
      E - The return type.
      Parameter:
      iterable - the iterable that should be flatMapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is flatMapped to a new result
    • arrayFlatMap

      public static <E> ObjectIterable<E> arrayFlatMap(DoubleIterable iterable, DoubleFunction<E[]> mapper)
      A Helper function that flatMaps a Iterable into a new Type.
      Typparameter:
      E - The return type.
      Parameter:
      iterable - the iterable that should be flatMapped
      mapper - the function that decides what the result turns into.
      Gibt zurück:
      a iterable that is flatMapped to a new result
    • filter

      public static DoubleIterable filter(Iterable<? extends Double> iterable, DoublePredicate filter)
      A Helper function that filters out all desired elements from a Java-Iterable
      Parameter:
      iterable - that should be filtered.
      filter - the filter that decides that should be let through
      Gibt zurück:
      a filtered iterable
    • filter

      public static DoubleIterable filter(DoubleIterable iterable, DoublePredicate filter)
      A Helper function that filters out all desired elements
      Parameter:
      iterable - that should be filtered.
      filter - the filter that decides that should be let through
      Gibt zurück:
      a filtered iterable
    • distinct

      public static DoubleIterable distinct(DoubleIterable iterable)
      A Helper function that filters out all duplicated elements.
      Parameter:
      iterable - that should be distinct
      Gibt zurück:
      a distinct iterable
    • distinct

      public static DoubleIterable distinct(Iterable<? extends Double> iterable)
      A Helper function that filters out all duplicated elements from a Java Iterable.
      Parameter:
      iterable - that should be distinct
      Gibt zurück:
      a distinct iterable
    • repeat

      public static DoubleIterable repeat(DoubleIterable iterable, int repeats)
      A Helper function that repeats the Iterable a specific amount of times
      Parameter:
      iterable - that should be repeated
      repeats - the amount of times the iterable should be repeated
      Gibt zurück:
      a repeating iterable
    • repeat

      public static DoubleIterable repeat(Iterable<? extends Double> iterable, int repeats)
      A Helper function that repeats the Iterable a specific amount of times from a Java Iterable
      Parameter:
      iterable - that should be repeated
      repeats - the amount of times the iterable should be repeated
      Gibt zurück:
      a repeating iterable
    • limit

      public static DoubleIterable limit(DoubleIterable iterable, long limit)
      A Helper function that hard limits the Iterable to a specific size
      Parameter:
      iterable - that should be limited
      limit - the amount of elements it should be limited to
      Gibt zurück:
      a limited iterable
    • limit

      public static DoubleIterable limit(Iterable<? extends Double> iterable, long limit)
      A Helper function that hard limits the Iterable to a specific size from a Java Iterable
      Parameter:
      iterable - that should be limited
      limit - the amount of elements it should be limited to
      Gibt zurück:
      a limited iterable
    • sorted

      public static DoubleIterable sorted(DoubleIterable iterable, DoubleComparator sorter)
      A Helper function that sorts the Iterable. This operation is heavily hurting performance because it rebuilds the entire iterator and then sorts it.
      Parameter:
      iterable - that should be sorted
      sorter - that sorts the iterable. Can be null.
      Gibt zurück:
      a sorted iterable.
    • sorted

      public static DoubleIterable sorted(Iterable<? extends Double> iterable, DoubleComparator sorter)
      A Helper function that sorts the Iterable from a Java Iterable This operation is heavily hurting performance because it rebuilds the entire iterator and then sorts it.
      Parameter:
      iterable - that should be sorted
      sorter - that sorts the iterable. Can be null.
      Gibt zurück:
      a sorted iterable.
    • peek

      public static DoubleIterable peek(DoubleIterable iterable, DoubleConsumer action)
      A Helper function that allows to preview the result of a Iterable.
      Parameter:
      iterable - that should be peeked at
      action - callback that receives the value before the iterable returns it
      Gibt zurück:
      a peeked iterable
    • peek

      public static DoubleIterable peek(Iterable<? extends Double> iterable, DoubleConsumer action)
      A Helper function that allows to preview the result of a Iterable from a Java Iterable
      Parameter:
      iterable - that should be peeked at
      action - callback that receives the value before the iterable returns it
      Gibt zurück:
      a peeked iterable
    • wrap

      public static DoubleIterable wrap(Iterable<? extends Double> iterable)
      A Wrapper function that wraps a Java-Iterable into a Type Specific Iterable
      Parameter:
      iterable - that should be wrapped
      Gibt zurück:
      a type specific iterable