Class AbsMatIndexer<T extends IBaseTemporalObject>

  • All Implemented Interfaces:
    IIndexer<T>
    Direct Known Subclasses:
    BasicEventIndexer, BasicTrackIndexer

    public abstract class AbsMatIndexer<T extends IBaseTemporalObject>
    extends Object
    implements IIndexer<T>
    Abstract class that implements some of the shared functionality of all the indexes that implement the IIndexer interface.
    Author:
    Thaddeus Gholston, Data Mining Lab, Georgia State University
    • Constructor Detail

      • AbsMatIndexer

        public AbsMatIndexer​(List<T> objectList,
                             int regionDimension,
                             int regionDivisor)
                      throws IllegalArgumentException
        Constructor that constructs the basic matrix used to index the objects in the indexes that are subclasses of this class.
        Parameters:
        objectList - The list of objects that are to be indexed in this index.
        regionDimension - The number of rows and columns that the underlying matrix used to index the list of objects shall have.
        regionDivisor - The value that is used to down size the objects that are to be indexed, so that they fit inside the scaled down space covered by the underlying matrix.
        Throws:
        IllegalArgumentException - Thrown when the object list is null, the regionDimension is < 1, or the regionDivisor is < 1.
    • Method Detail

      • buildIndex

        protected abstract void buildIndex()
        The function that indexes the passed in objects. Since each object is different in how it is indexed, this is implemented by each index implementation. This must be called before any spatial query will return the correct list of objects.
      • getAll

        public List<T> getAll()
        Description copied from interface: IIndexer
        Returns the list of all objects in the index.
        Specified by:
        getAll in interface IIndexer<T extends IBaseTemporalObject>
        Returns:
        A list of all the objects in the index.
      • getFirstTime

        public org.joda.time.DateTime getFirstTime()
        Description copied from interface: IIndexer
        Gets the earliest start time in the index. That way you can check before you waste time querying the index for objects that don't exist.
        Specified by:
        getFirstTime in interface IIndexer<T extends IBaseTemporalObject>
        Returns:
        The earliest start time in the index.
      • getLastTime

        public org.joda.time.DateTime getLastTime()
        Description copied from interface: IIndexer
        Gets the latest end time in the index. That way you can check before you waste time querying the index for objects that don't exist.
        Specified by:
        getLastTime in interface IIndexer<T extends IBaseTemporalObject>
        Returns:
        The latest end time in the index.
      • search

        public ArrayList<T> search​(org.joda.time.Interval timePeriod,
                                   org.locationtech.jts.geom.Geometry searchArea)
        Description copied from interface: IIndexer
        Searches the index for any objects that intersect the query time and the query search area. This method is intended to look forward in time for these objects as is done to find the next possible detection for a given detection.
        Specified by:
        search in interface IIndexer<T extends IBaseTemporalObject>
        Parameters:
        timePeriod - The time period to query the index with.
        searchArea - The search area to search for intersections with.
        Returns:
        A list of the objects in the index that intersect the query time and the query search area.