Package ch.obermuhlner.math.big.stream
Class BigDecimalStream
java.lang.Object
ch.obermuhlner.math.big.stream.BigDecimalStream
Provides constructor methods for streams of
BigDecimal
elements.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stream
<BigDecimal> range
(double startInclusive, double endExclusive, double step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.static Stream
<BigDecimal> range
(long startInclusive, long endExclusive, long step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.static Stream
<BigDecimal> range
(BigDecimal startInclusive, BigDecimal endExclusive, BigDecimal step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.static Stream
<BigDecimal> rangeClosed
(double startInclusive, double endInclusive, double step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.static Stream
<BigDecimal> rangeClosed
(long startInclusive, long endInclusive, long step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.static Stream
<BigDecimal> rangeClosed
(BigDecimal startInclusive, BigDecimal endInclusive, BigDecimal step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.
-
Constructor Details
-
BigDecimalStream
public BigDecimalStream()
-
-
Method Details
-
range
public static Stream<BigDecimal> range(BigDecimal startInclusive, BigDecimal endExclusive, BigDecimal step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.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 valueendExclusive
- the exclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
-
range
public static Stream<BigDecimal> range(long startInclusive, long endExclusive, long step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.The
long
arguments are converted usingBigDecimal.valueOf(long)
.- Parameters:
startInclusive
- the (inclusive) initial valueendExclusive
- the exclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
- See Also:
-
range
public static Stream<BigDecimal> range(double startInclusive, double endExclusive, double step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendExclusive
(exclusive) by an incrementalstep
.The
double
arguments are converted usingBigDecimal.valueOf(double)
.- Parameters:
startInclusive
- the (inclusive) initial valueendExclusive
- the exclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
- See Also:
-
rangeClosed
public static Stream<BigDecimal> rangeClosed(BigDecimal startInclusive, BigDecimal endInclusive, BigDecimal step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.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 valueendInclusive
- the inclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
- See Also:
-
rangeClosed
public static Stream<BigDecimal> rangeClosed(long startInclusive, long endInclusive, long step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.The
long
arguments are converted usingBigDecimal.valueOf(long)
.- Parameters:
startInclusive
- the (inclusive) initial valueendInclusive
- the inclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
- See Also:
-
rangeClosed
public static Stream<BigDecimal> rangeClosed(double startInclusive, double endInclusive, double step, MathContext mathContext) Returns a sequential orderedStream<BigDecimal>
fromstartInclusive
(inclusive) toendInclusive
(inclusive) by an incrementalstep
.The
double
arguments are converted usingBigDecimal.valueOf(double)
.- Parameters:
startInclusive
- the (inclusive) initial valueendInclusive
- the inclusive upper boundstep
- the step between elementsmathContext
- theMathContext
used for all mathematical operations- Returns:
- a sequential
Stream<BigDecimal>
- See Also:
-