Class BigDecimalStream


  • public class BigDecimalStream
    extends java.lang.Object
    Provides constructor methods for streams of BigDecimal elements.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.stream.Stream<java.math.BigDecimal> range​(double startInclusive, double endExclusive, double step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.
      static java.util.stream.Stream<java.math.BigDecimal> range​(long startInclusive, long endExclusive, long step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.
      static java.util.stream.Stream<java.math.BigDecimal> range​(java.math.BigDecimal startInclusive, java.math.BigDecimal endExclusive, java.math.BigDecimal step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.
      static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(double startInclusive, double endInclusive, double step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.
      static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(long startInclusive, long endInclusive, long step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.
      static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(java.math.BigDecimal startInclusive, java.math.BigDecimal endInclusive, java.math.BigDecimal step, java.math.MathContext mathContext)
      Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BigDecimalStream

        public BigDecimalStream()
    • Method Detail

      • range

        public static java.util.stream.Stream<java.math.BigDecimal> range​(java.math.BigDecimal startInclusive,
                                                                          java.math.BigDecimal endExclusive,
                                                                          java.math.BigDecimal step,
                                                                          java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.

        An equivalent sequence of increasing values can be produced sequentially using a for loop as follows:

        for (BigDecimal i = startInclusive; i.compareTo(endExclusive) < 0; i = i.add(step, mathContext)) {
            // ...
        }
        Parameters:
        startInclusive - the (inclusive) initial value
        endExclusive - the exclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
      • range

        public static java.util.stream.Stream<java.math.BigDecimal> range​(long startInclusive,
                                                                          long endExclusive,
                                                                          long step,
                                                                          java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.

        The long arguments are converted using BigDecimal.valueOf(long).

        Parameters:
        startInclusive - the (inclusive) initial value
        endExclusive - the exclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
        See Also:
        range(BigDecimal, BigDecimal, BigDecimal, MathContext)
      • range

        public static java.util.stream.Stream<java.math.BigDecimal> range​(double startInclusive,
                                                                          double endExclusive,
                                                                          double step,
                                                                          java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endExclusive (exclusive) by an incremental step.

        The double arguments are converted using BigDecimal.valueOf(double).

        Parameters:
        startInclusive - the (inclusive) initial value
        endExclusive - the exclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
        See Also:
        range(BigDecimal, BigDecimal, BigDecimal, MathContext)
      • rangeClosed

        public static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(java.math.BigDecimal startInclusive,
                                                                                java.math.BigDecimal endInclusive,
                                                                                java.math.BigDecimal step,
                                                                                java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.

        An equivalent sequence of increasing values can be produced sequentially using a for loop as follows:

        for (BigDecimal i = startInclusive; i.compareTo(endInclusive) <= 0; i = i.add(step, mathContext)) {
            // ...
        }
        Parameters:
        startInclusive - the (inclusive) initial value
        endInclusive - the inclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
        See Also:
        range(BigDecimal, BigDecimal, BigDecimal, MathContext)
      • rangeClosed

        public static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(long startInclusive,
                                                                                long endInclusive,
                                                                                long step,
                                                                                java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.

        The long arguments are converted using BigDecimal.valueOf(long).

        Parameters:
        startInclusive - the (inclusive) initial value
        endInclusive - the inclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
        See Also:
        rangeClosed(BigDecimal, BigDecimal, BigDecimal, MathContext)
      • rangeClosed

        public static java.util.stream.Stream<java.math.BigDecimal> rangeClosed​(double startInclusive,
                                                                                double endInclusive,
                                                                                double step,
                                                                                java.math.MathContext mathContext)
        Returns a sequential ordered Stream<BigDecimal> from startInclusive (inclusive) to endInclusive (inclusive) by an incremental step.

        The double arguments are converted using BigDecimal.valueOf(double).

        Parameters:
        startInclusive - the (inclusive) initial value
        endInclusive - the inclusive upper bound
        step - the step between elements
        mathContext - the MathContext used for all mathematical operations
        Returns:
        a sequential Stream<BigDecimal>
        See Also:
        rangeClosed(BigDecimal, BigDecimal, BigDecimal, MathContext)