The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

justin.musgrove (3) [Avatar] Offline
#1
"Java 8 introduces two static methods available on IntStream, DoubleStream and LongStream to help generate such ranges: range and rangeClosed."

It appears that range and rangeClosed only exists on IntStream not Double/LongStream per java docs.

http://download.java.net/jdk8/docs/api/java/util/stream/IntStream.html

http://download.java.net/jdk8/docs/api/java/util/stream/DoubleStream.html

http://download.java.net/jdk8/docs/api/java/util/stream/LongStream.html
cemsultan (19) [Avatar] Offline
#2
Re: 4.7.2 Numeric ranges
You mean it only exists on IntStream & LongStream, but not DoubleStream. Also, I did a quick test for DoubleStream, just in case range() and rangeClosed() methods were forgotten.
justin.musgrove (3) [Avatar] Offline
#3
Re: 4.7.2 Numeric ranges
@cemsultan, if I am interpreting your statement correctly, you ran a test on doubleStream and you did see a range? What release version are you using? I too ran a test and DoubleStream.range/LongStream.range do not exists. I am on hotel wifi so the speed is pretty crappy but I will try to update to check out the latest release.

Maybe I am missing something, if you click the links above the java docs for DoubleStream and LongStream do not have a range or a range closed listed.
cemsultan (19) [Avatar] Offline
#4
Re: 4.7.2 Numeric ranges
@justin.musgrove no, what I meant was I did a quick test on javac (version1.8.0-ea) on DoubleStream, just in case range() and rangeClosed() methods were forgotten in the documentation. That is, my test confirmed that both range() and rangeClosed() methods are not included and by the way, it's also not mentioned in the Java SE 8 specification.

Please do note regarding your first post that both range() and rangeClosed() methods are 'not in Double/LongStream per java docs', actually these methods do exist for LongStream, but not for DoubleStream.

Thanks.