Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As others have mentioned you first want to see if this is a problem before changing your design etc. If it is a problem and / or you dealing with a lot of sparse data then a sparse data structure might be more applicable for the problem. I will post a very simple naive implementation later (as I am unable to at the moment) but a two dimensional sparse matrix would do what you desire. </p> <p>The concept is that a single format (either string or class) will be stored for a given cell range e.g. 1-1000. To benefit from this you have to make some design changes... The format property will need to be removed from the cell class. Instead the format should be registered either in the table class or preferably with another class. For example</p> <pre><code>public class CellFormats { .... public void Register(int start, int finish, string format); } </code></pre> <p>The cell formats class will contain the sparse matrix which will contain a format for a range.</p> <p>The Table class will then utilise the CellFormats class. Instead of having a method called GetCellFormat it would have a method with the following signature</p> <pre><code>void ApplyCellFormat(Position cellPosition) </code></pre> <p>This would retrieve the cell format from the CellFormats class (sparse matrix) and apply it to the cell. </p> <p>This technique can dramatically reduce memory usage if the data is common and applied to large ranges. But as I have already said, you need to ensure this is cause of the problem before making your design more complex by adding code like this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload