Class LocalMDoubleStream

    • Constructor Detail

      • LocalMDoubleStream

        public LocalMDoubleStream​(@NonNull
                                  @NonNull DoubleStream stream)
    • Method Detail

      • allMatch

        public boolean allMatch​(@NonNull
                                @NonNull SerializableDoublePredicate predicate)
        Description copied from interface: MDoubleStream
        Determines if all doubles in the stream evaluate to true with the given predicate
        Specified by:
        allMatch in interface MDoubleStream
        Parameters:
        predicate - the predicate to test double entries with
        Returns:
        True if all elements in the stream evaluate to true
      • anyMatch

        public boolean anyMatch​(@NonNull
                                @NonNull SerializableDoublePredicate predicate)
        Description copied from interface: MDoubleStream
        Determines if any of the doubles in the stream evaluate to true with the given predicate
        Specified by:
        anyMatch in interface MDoubleStream
        Parameters:
        predicate - the predicate to test double entries with
        Returns:
        True if any of the elements in the stream evaluate to true
      • count

        public long count()
        Description copied from interface: MDoubleStream
        The number of items in the stream
        Specified by:
        count in interface MDoubleStream
        Returns:
        the number of items in the stream
      • flatMap

        public MDoubleStream flatMap​(@NonNull
                                     @NonNull SerializableDoubleFunction<double[]> mapper)
        Description copied from interface: MDoubleStream
        Maps the doubles in this stream to one or more new doubles using the given function.
        Specified by:
        flatMap in interface MDoubleStream
        Parameters:
        mapper - the function to use to map objects
        Returns:
        the new stream
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: MDoubleStream
        Determines if the stream is empty or not
        Specified by:
        isEmpty in interface MDoubleStream
        Returns:
        True if empty, False otherwise
      • limit

        public MDoubleStream limit​(int n)
        Description copied from interface: MDoubleStream
        Limits the stream to the first number items.
        Specified by:
        limit in interface MDoubleStream
        Parameters:
        n - the number of items desired
        Returns:
        the new stream of size number
      • mapToObj

        public <T> MStream<T> mapToObj​(@NonNull
                                       @NonNull SerializableDoubleFunction<? extends T> function)
        Description copied from interface: MDoubleStream
        Maps the doubles in the stream to objects using the given function
        Specified by:
        mapToObj in interface MDoubleStream
        Type Parameters:
        T - the component type of the returning stream
        Parameters:
        function - the function to use to map doubles
        Returns:
        the new stream
      • max

        public OptionalDouble max()
        Description copied from interface: MDoubleStream
        Returns the max item in the stream.
        Specified by:
        max in interface MDoubleStream
        Returns:
        the optional containing the max value
      • mean

        public double mean()
        Description copied from interface: MDoubleStream
        The mean value of the stream
        Specified by:
        mean in interface MDoubleStream
        Returns:
        the mean value
      • min

        public OptionalDouble min()
        Description copied from interface: MDoubleStream
        Returns the min item in the stream.
        Specified by:
        min in interface MDoubleStream
        Returns:
        the optional containing the min value
      • noneMatch

        public boolean noneMatch​(@NonNull
                                 @NonNull SerializableDoublePredicate predicate)
        Description copied from interface: MDoubleStream
        Determines if none of the doubles in the stream evaluate to true with the given predicate
        Specified by:
        noneMatch in interface MDoubleStream
        Parameters:
        predicate - the predicate to test double entries with
        Returns:
        True if none of the elements in the stream evaluate to true
      • onClose

        public MDoubleStream onClose​(@NonNull
                                     @NonNull SerializableRunnable onCloseHandler)
        Description copied from interface: MDoubleStream
        Sets the handler to call when the stream is closed. Typically, this is to clean up any open resources, such as file handles.
        Specified by:
        onClose in interface MDoubleStream
        Parameters:
        onCloseHandler - the handler to run when the stream is closed.
      • reduce

        public OptionalDouble reduce​(@NonNull
                                     @NonNull SerializableDoubleBinaryOperator operator)
        Description copied from interface: MDoubleStream
        Performs a reduction on the elements of this stream using the given binary operator.
        Specified by:
        reduce in interface MDoubleStream
        Parameters:
        operator - the binary operator used to combine two objects
        Returns:
        the optional describing the reduction
      • reduce

        public double reduce​(double zeroValue,
                             @NonNull
                             @NonNull SerializableDoubleBinaryOperator operator)
        Description copied from interface: MDoubleStream
        Performs a reduction on the elements of this stream using the given binary operator.
        Specified by:
        reduce in interface MDoubleStream
        Parameters:
        zeroValue - the starting value for the reduction
        operator - the binary operator used to combine two objects
        Returns:
        the optional describing the reduction
      • repartition

        public MDoubleStream repartition​(int numberOfPartition)
        Description copied from interface: MDoubleStream
        Repartitions the stream to the given number of partitions. This may be a no-op for some streams, i.e. Local Streams.
        Specified by:
        repartition in interface MDoubleStream
        Parameters:
        numberOfPartition - the number of partitions the stream should have
        Returns:
        the new stream
      • skip

        public MDoubleStream skip​(int n)
        Description copied from interface: MDoubleStream
        Skips the first n items in the stream
        Specified by:
        skip in interface MDoubleStream
        Parameters:
        n - the number of items in the stream
        Returns:
        the new stream
      • sorted

        public MDoubleStream sorted​(boolean ascending)
        Description copied from interface: MDoubleStream
        Sorts the double stream in ascending order.
        Specified by:
        sorted in interface MDoubleStream
        Parameters:
        ascending - determines if the items should be sorted in ascending (true) or descending (false) order
        Returns:
        the new double stream
      • stddev

        public double stddev()
        Description copied from interface: MDoubleStream
        Calculates the standard deviation of the stream
        Specified by:
        stddev in interface MDoubleStream
        Returns:
        the standard deviation
      • sum

        public double sum()
        Description copied from interface: MDoubleStream
        Calculates the sum of the stream
        Specified by:
        sum in interface MDoubleStream
        Returns:
        the sum
      • toArray

        public double[] toArray()
        Description copied from interface: MDoubleStream
        Collects the values of the stream as a double array.
        Specified by:
        toArray in interface MDoubleStream
        Returns:
        the double array
      • union

        public MDoubleStream union​(@NonNull
                                   @NonNull MDoubleStream other)
        Description copied from interface: MDoubleStream
        Unions this stream with another
        Specified by:
        union in interface MDoubleStream
        Parameters:
        other - the other stream to append to this one
        Returns:
        the new double stream