Open
Description
I found that the API of CtQuery
is somewhat limited. It functions essentially, as I understand it, similarly to a stream of CtElements
, but is limited to consumption by CtConsumer
s and collection into lists. I came across the discussion in #1070 and the limitations are justified by the fact that the implementation is based on CtScanner
. Is there a reason that CtScanner
must be used?
Now that there is #1986, the following is possible:
Stream<CtElement> query = StreamSupport.stream(element.asIterable().spliterator(), false);
From what I understand, this can replace CtQuery
. Can java stream replace the query API? If not what are the missing features or differing behaviours? Is it possible to reimplement/refactor CtQuery
to use streams internally?