package com.oculusinfo.binning;

import java.io.Serializable;
import java.util.Collection;

/**
 * Created by nkronenfeld on 1/27/2015.
 */
public interface TileData<T> extends Serializable {
	/**
	 * A catalog of available types of ways to store tiles available in the system.
	 */
	public static enum StorageType {
		/** Tiles stored as dense arrays */
		Dense(DenseTileData.class),
		/** Tiles stored as sparse maps, indexed by bin */
		Sparse(SparseTileData.class);

		private Class<? extends TileData> _tileClass;
		private StorageType (Class<? extends TileData> tileClass) {
			_tileClass = tileClass;
		}
		public Class<? extends TileData> tileClass () {
			return _tileClass;
		}
	}



	/**
	 * Get the tile index defining which tile is associated with this data
	 *
	 * @return The TileIndex of the tile
	 */
	TileIndex getDefinition();

	/**
	 * Set the value of a particular bin in this tile
	 *
	 * @param x The x coordinate of the bin to be changed.
	 * @param y The y coordinate of the bin to be changed.
	 * @param value The value to which to set the bin in question.
	 */
	void setBin (int x, int y, T value);

	/**
	 * Get the value of a particular bin in this tile.
	 *
	 * @param x The x coordinate of the bin to be changed.
	 * @param y The y coordinate of the bin to be changed.
	 * @return The value of the bin in question.
	 */
	T getBin(int x, int y);

	/**
	 * Get the properties listed in the metadata of this tile.
	 *
	 * @return A collection of listed properties.  This can be null if
	 *         there are no listed properties.
	 */
	Collection<String> getMetaDataProperties();

	/**
	 * Get the value of the given metadata property.
	 *
	 * @param property The property of interest
	 * @return The value of the given property, or null if the property
	 *         isn't listed in the tile's metadata.
	 */
	String getMetaData(String property);

	/**
	 * Sets the value for a given property in the tile's metadata.
	 *
	 * @param property The property of interest
	 * @param value The value of said property
	 */
	void setMetaData(String property, Object value);
}

@@ -1,8 +1,1194 @@
+/*%0A * Copyright (c) 2014 Oculus Info Inc. http://www.oculusinfo.com/%0A *%0A * Released under the MIT License.%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A */%0A
 package 

Add license to new TileData interface