1 package tim.prune.function.cache;
4 * Class to hold the information for a single table row.
5 * Used to describe a tileset or for a single zoom level of a tileset.
9 private int _zoom = -1;
10 private int _minZoom = -1, _maxZoom = -1;
11 private int _numTiles = 0;
12 private long _totalSize = 0L;
17 * @param inZoom zoom level
19 public void setZoom(int inZoom) {
24 * Add a zoom level and adjust max/min
25 * @param inZoom zoom level
27 public void addZoom(int inZoom)
29 if (_minZoom < 0 || _minZoom > inZoom)
31 if (_maxZoom < inZoom)
36 * @return the zoom level
38 public int getZoom() {
43 * @return the zoom range as a string
45 public String getZoomRange()
47 if (_minZoom < 0 && _maxZoom < 0) return "";
48 if (_minZoom == _maxZoom || _maxZoom < 0) return "" + _minZoom;
49 if (_minZoom < 0) return "" + _maxZoom;
50 return "" + _minZoom + " - " + _maxZoom;
54 * Add a single tile of the given size
55 * @param inSize size in bytes
57 public void addTile(long inSize) {
63 * @param inNumTiles number of tiles to add
64 * @param inSize total size of the tiles in bytes
66 public void addTiles(int inNumTiles, long inSize)
68 _numTiles += inNumTiles;
73 * @return the total number of tiles found
75 public int getNumTiles() {
80 * @return the total size of the tiles in bytes
82 public long getTotalSize() {
88 * Add the given RowInfo object to this one
89 * @param inOther other row object
91 public void addRow(RowInfo inOther)
95 _numTiles += inOther._numTiles;
96 _totalSize += inOther._totalSize;
99 if (inOther._minZoom > 0)
100 addZoom(inOther._minZoom);
101 if (inOther._maxZoom > 0)
102 addZoom(inOther._maxZoom);
103 if (inOther._zoom > 0)
104 addZoom(inOther._zoom);