Returns the sum of all numeric elements in the stream. @return the sum of all elements
()
| 471 | * @return the sum of all elements |
| 472 | */ |
| 473 | public Number sum() { |
| 474 | Number sum = Long.valueOf(0); |
| 475 | |
| 476 | while (iterator.hasNext()) { |
| 477 | sum = ELArithmetic.add(sum, iterator.next()); |
| 478 | } |
| 479 | |
| 480 | return sum; |
| 481 | } |
| 482 | |
| 483 | |
| 484 | /** |
no test coverage detected