de.matthiasmann.twl.utils
Class SparseGrid

java.lang.Object
  extended by de.matthiasmann.twl.utils.SparseGrid

public class SparseGrid
extends java.lang.Object

A 2d sparse grid built using a B+Tree. Rows are the major axis. Operations on column ranges are slower.


Nested Class Summary
static class SparseGrid.Entry
           
static interface SparseGrid.GridFunction
           
 
Constructor Summary
SparseGrid(int pageSize)
           
 
Method Summary
 void clear()
           
 SparseGrid.Entry get(int row, int column)
           
 void insertColumns(int column, int count)
           
 void insertRows(int row, int count)
           
 boolean isEmpty()
           
 void iterate(int startRow, int startColumn, int endRow, int endColumn, SparseGrid.GridFunction func)
           
 SparseGrid.Entry remove(int row, int column)
           
 void removeColumns(int column, int count)
           
 void removeRows(int row, int count)
           
 void set(int row, int column, SparseGrid.Entry entry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseGrid

public SparseGrid(int pageSize)
Method Detail

get

public SparseGrid.Entry get(int row,
                            int column)

set

public void set(int row,
                int column,
                SparseGrid.Entry entry)

remove

public SparseGrid.Entry remove(int row,
                               int column)

insertRows

public void insertRows(int row,
                       int count)

insertColumns

public void insertColumns(int column,
                          int count)

removeRows

public void removeRows(int row,
                       int count)

removeColumns

public void removeColumns(int column,
                          int count)

iterate

public void iterate(int startRow,
                    int startColumn,
                    int endRow,
                    int endColumn,
                    SparseGrid.GridFunction func)

isEmpty

public boolean isEmpty()

clear

public void clear()