Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void removeCol(int col) {
- for (int i = entries.size() - 1; i >= 0; i--) {
- SparseArrayEntry entry = entries.get(i);
- if (entry.getCol() > col) {
- // Fix the column number for this item because it's in a column
- // to the right of the column we're removing
- SparseArrayEntry fixedEntry = new SparseArrayEntry(entry.getRow(),
- entry.getCol() - 1,
- entry.getValue());
- entries.set(i, fixedEntry);
- }
- else if (entry.getCol() == col) {
- // Remove this item because it's inside the column we're removing
- entries.remove(i);
- }
- }
- // Update the numCols variable since we removed one column.
- numCols--;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement