using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Geospatial
{
    public interface ISpatialTemporalIndexer<T>
    {
        /// <summary>
        /// Index new spatio-temporal value
        /// </summary>
        /// <param name="geography">The spatial key</param>
        /// <param name="value">The metadata to index</param>
        /// <param name="experitionDate">The temporal key</param>
        /// <returns>The new tree node</returns>
        RTreeInfoNode<T> Index(IGeography geography, T value, long experitionDate);

        /// <summary>
        /// Index new spatial value
        /// </summary>
        /// <param name="geography">The spatial key</param>
        /// <param name="value">The metadata to index</param>
        /// <returns>The new tree node</returns>
        RTreeInfoNode<T> Index(IGeography geography, T value);

        /// <summary>
        /// Find a spatial value
        /// </summary>
        /// <param name="geography">The position in space to search</param>
        /// <param name="valueT">The metadata to validate on that position</param>
        /// <param name="matchingMethod">The matching method used to verify equality between geometries and metadata</param>
        /// <returns>The list of items that match the matchingMethod</returns>
        IList<RTreeInfoNode<T>> Find(IGeography geography, T valueT, Func<IGeography, T, bool> matchingMethod);
        
        /// <summary>
        /// Expire all items up to that date
        /// </summary>
        /// <param name="expiritionDate">The date to expire items</param>
        void Expire(long experitionDate);
    }
}
