Package edu.gsu.cs.dmlab.indexes
Class TreeBasedEventIndexer
- java.lang.Object
-
- edu.gsu.cs.dmlab.indexes.TreeBasedEventIndexer
-
- All Implemented Interfaces:
IIndexer<ISTTrackingEvent>
,ISTTrackingEventIndexer
public class TreeBasedEventIndexer extends Object implements ISTTrackingEventIndexer
- Author:
- Thaddeus Gholston, Data Mining Lab, Georgia State University
-
-
Constructor Summary
Constructors Constructor Description TreeBasedEventIndexer(ArrayList<ISTTrackingEvent> regionalList, int regionDivisor, org.joda.time.Duration frameSpan)
Constructor, constructs a new TreeBasedEventIndexer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayList<ISTTrackingEvent>
getAll()
Returns the list of all objects in the index.int
getExpectedChangePerFrame(org.joda.time.Interval timePeriod)
Computes the expected change in the number of detections in each frame.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.EventType
getTypeIndexed()
Returns the event type that is indexed in this event indexer.ArrayList<ISTTrackingEvent>
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.
-
-
-
Constructor Detail
-
TreeBasedEventIndexer
public TreeBasedEventIndexer(ArrayList<ISTTrackingEvent> regionalList, int regionDivisor, org.joda.time.Duration frameSpan) throws IllegalArgumentException
Constructor, constructs a new TreeBasedEventIndexer.- Parameters:
regionalList
- The list of IEvent objects to add to the index.regionDivisor
- The divisor used to down size each of the IEvent objects to fit inside the spatial domain specified by the regionDimension parameter.frameSpan
- The length of a frame in the index. This is used to compute the expected change in detections per frame.- Throws:
IllegalArgumentException
- When any of the passed in arguments are null, or if the regionDivisor is less than 1 same with frame span.
-
-
Method Detail
-
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<ISTTrackingEvent>
- 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<ISTTrackingEvent>
- Returns:
- The latest end time in the index.
-
search
public ArrayList<ISTTrackingEvent> 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<ISTTrackingEvent>
- 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.
-
getAll
public ArrayList<ISTTrackingEvent> getAll()
Description copied from interface:IIndexer
Returns the list of all objects in the index.- Specified by:
getAll
in interfaceIIndexer<ISTTrackingEvent>
- Returns:
- A list of all the objects in the index.
-
getExpectedChangePerFrame
public int getExpectedChangePerFrame(org.joda.time.Interval timePeriod)
Description copied from interface:ISTTrackingEventIndexer
Computes the expected change in the number of detections in each frame. The length of the frame is set internally but the time that this expected change is to be computed over is passed in as a parameter.- Specified by:
getExpectedChangePerFrame
in interfaceISTTrackingEventIndexer
- Parameters:
timePeriod
- The period over which the expected change is to be computed.- Returns:
- The expected change in the number of detections per frame based on the passed in period of time.
-
getTypeIndexed
public EventType getTypeIndexed()
Description copied from interface:ISTTrackingEventIndexer
Returns the event type that is indexed in this event indexer.- Specified by:
getTypeIndexed
in interfaceISTTrackingEventIndexer
- Returns:
- Event type of the events in the indexer.
-
-