Before I write my own, is there an open source tablemodel that automatically collapses columns that contain all nulls?

StackOverflow https://stackoverflow.com/questions/17049114

Question

So given a two dimensional array (actually an ArrayList<ArrayList<Object>>) of raw data as such:

A      B      C     D     E

Bob    null   42    null  null
Sam    null   38    blue  0
Tom    null   35    brown null

The java tablemodel I'm contemplating writing would automatically collapse Column B.

I've tried a google search for something open source but I haven't had much luck. Does something like this already exist?

In my particular use case, I have hundreds of columns and thousands of rows. At least 30 percent of the columns (sometimes more) are null. However from one query to the next, the columns that are blank can vary. The user understandable is frustrated with scrolling left and right over a sea of blank columns.

Any thoughts are greatly appreciated. I'm also concerned about performance.

-Dennis

Was it helpful?

Solution

I don't think performance will be an issue for this process because you can stop iterating the column of the array when the first non null element is found.

Also the process to compare is really quick matrix[i][j]!=null, it doesn't take any complex processing.

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