net.sourceforge.nite.gui.textviewer
Class TimeIntervalMapper

java.lang.Object
  extended by net.sourceforge.nite.gui.textviewer.TimeIntervalMapper

public class TimeIntervalMapper
extends java.lang.Object

Class for efficiently selecting objects which overlap particular points on a timeline. Jonathan added span handling 16/9/04.

Author:
judy

Constructor Summary
TimeIntervalMapper()
          Construct an empty TimeIntervalMapper.
 
Method Summary
 void addObject(java.lang.Object o, double startTime, double endTime)
          Method addObject.
 void dumpBuckets()
          Utility method to dump the internal "bucket" data structures used by this TimeIntervalMapper.
 java.util.Set getObjectsForTime(double time)
          Get the set of timed objects which overlap the specified time.
 TimeIntervalIterator getTimeIntervalIterator()
          Get a TimeIntervalIterator object which allows efficient iteration across the contents of this TimeIntervalMapper.
 void removeObject(java.lang.Object o, double startTime, double endTime)
          Remove the specified object from the buckets
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeIntervalMapper

public TimeIntervalMapper()
Construct an empty TimeIntervalMapper.

Method Detail

removeObject

public void removeObject(java.lang.Object o,
                         double startTime,
                         double endTime)
Remove the specified object from the buckets

Parameters:
o -
startTime -
endTime -

addObject

public void addObject(java.lang.Object o,
                      double startTime,
                      double endTime)
Method addObject.

Parameters:
o - The object to add.
startTime - The start time of the object.
endTime - The end time of the object.

getObjectsForTime

public java.util.Set getObjectsForTime(double time)
Get the set of timed objects which overlap the specified time.

Parameters:
time - The time at which objects should be found.
Returns:
A Set of matching objects, or an empty set for no matches.

getTimeIntervalIterator

public TimeIntervalIterator getTimeIntervalIterator()
Get a TimeIntervalIterator object which allows efficient iteration across the contents of this TimeIntervalMapper.

Returns:
TimeIntervalIterator

dumpBuckets

public void dumpBuckets()
Utility method to dump the internal "bucket" data structures used by this TimeIntervalMapper.