public TileData<List<T>> harden () { TileIndex index = getDefinition(); if (isDense()) { DenseTileData<List<T>> hardened = new DenseTileData<>(index); hardened.setDefaultValue(_base.getDefaultValue()); for (int x=0; x<index.getXBins(); ++x) { for (int y=0; y<index.getYBins(); ++y) { hardened.setBin(x, y, getBin(x, y)); } } return hardened; } else { SparseTileData<List<T>> hardened = new SparseTileData<>(index, _base.getDefaultValue()); for (int x=0; x<index.getXBins(); ++x) { for (int y=0; y<index.getYBins(); ++y) { List<T> value = getBin(x, y); if (null != value) { hardened.setBin(x, y, getBin(x, y)); } } } return hardened; } }