Stream reuse in superclass (original) (raw)

Jose jgetino at telefonica.net
Fri Apr 5 06:48:49 PDT 2013


Maybe you could zoom out and actually tell people what problem you are trying to solve? There is almost certainly a better solution here.

OK, ill try

public void addRows(Stream rows) { rows.forEach(records::add); fireTableDataChanged(); }

So, when adding new rows to the table I must also register the table as a listener to the added rows, which forces me to override the base method that consumes the stream of Foos.

This is the point I'm now. The cuurent code is below, I can't imagine any bad with it:

public void addRows(Stream rows) { rows=rows.peek(row -> row.addReceiver(this)); super.addRows(rows); }



More information about the lambda-dev mailing list