Class AbsMatIndexer<T extends IBaseTemporalObject>
- java.lang.Object
-
- edu.gsu.cs.dmlab.indexes.interfaces.AbsMatIndexer<T>
-
- 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbsMatIndexer.LockingArrayList<B>
-
Field Summary
Fields Modifier and Type Field Description protected List<T>
objectList
protected int
regionDimension
protected int
regionDivisor
protected ArrayList<IBaseTemporalObject>[][]
searchSpace
-
Constructor Summary
Constructors Constructor Description AbsMatIndexer(List<T> objectList, int regionDimension, int regionDivisor)
Constructor that constructs the basic matrix used to index the objects in the indexes that are subclasses of this class.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
buildIndex()
The function that indexes the passed in objects.void
finalize()
List<T>
getAll()
Returns the list of all objects in the index.org.joda.time.DateTime
getFirstTime()
Gets the earliest start time in the index.org.joda.time.DateTime
getLastTime()
Gets the latest end time in the index.ArrayList<T>
search(org.joda.time.Interval timePeriod, org.locationtech.jts.geom.Geometry searchArea)
Searches the index for any objects that intersect the query time and the query search area.
-
-
-
Field Detail
-
searchSpace
protected ArrayList<IBaseTemporalObject>[][] searchSpace
-
objectList
protected List<T extends IBaseTemporalObject> objectList
-
regionDivisor
protected int regionDivisor
-
regionDimension
protected int regionDimension
-
-
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
-
finalize
public void finalize() throws Throwable
-
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 interfaceIIndexer<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 interfaceIIndexer<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 interfaceIIndexer<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 interfaceIIndexer<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.
-
-