Make BaseStream public?

Brian Goetz brian.goetz at oracle.com
Mon Jul 1 13:39:38 PDT 2013


I am currently crawling through the docs getting ready for another pass 
on the specification.  The good news is that the class hierarchy has 
simplified a lot since the first pass.  The bad news is I am trying to 
tack a course between the twin evils of duplicated documentation and 
excessive linking (each level of linking loses some percentage of the 
readers.)

The classes Stream, IntStream, LongStream, and DoubleStream all 
implement BaseStream, which describes behaviors common to all streams 
(closeability, iterator/spliterator, sequential/parallel, ordering). 
Currently BaseStream is package-private, but I am thinking that it might 
be valuable to elevate it to public, for possibly two reasons:

  - Having a common supertype allows library code to abstract over all 
stream types.  Our tests use this ability, for example.

  - Most of the documentation for the stream classes (sequential and 
parallel behavior, ordering, etc) is generic to all stream types, so 
putting it in one base class (where it can be @inheritDoc'ed or linked) 
is more natural than cutting and pasting it in N places, or dumping it 
all in the package doc.



More information about the lambda-libs-spec-experts mailing list