Question

I wanted to ask for a clarification about the use of RowFilter and its effects on performances. I implemented a filter through the method include(Entry) that for every row simply checks if its correspondent value in the model has a boolean flag set: if so, returns true, else false.

Now, the JTable I have can be pretty big (1000000+ rows), and I wasn't sure if this simple filtering, applied to such a big input set, could be costly.

How does the mapping between filtered rows and underlying data work exactly? I mean, does it store any extra data or it just draws the rows that match the filter "on the fly"??

Thank you very much for the clarifications.

Was it helpful?

Solution

no component in any of programing languages aren't designated to displaying too largiest matrix of data on the screen, then you have two choises

  1. faster way is let's this job for SQL engine, that designated for searching and filtering rows in hugest Database table

  2. slower way is hold these data in HashMap and there apply Comparator, and JTable would be display only result from this Comparator

OTHER TIPS

Expanding on @mKorbel's second point, a TableModel for a very large data set may contain a List<Record>, as suggested here. The list may be sorted using a suitable Comparator and dynamically partitioned using the subList() method. At any one time, the corresponding JTable can only see one such partition, and separate controls will be required to change partitions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top