com.bbn.openmap.omGraphics.time
Class TemporalSupport

java.lang.Object
  extended by com.bbn.openmap.omGraphics.time.TemporalSupport
Direct Known Subclasses:
TemporalPointSupport

public abstract class TemporalSupport
extends java.lang.Object

The TemporalSupport object is intended to provide rudimentary support for choosing the right temporal status for a given time. A list of TemporalRecord objects are managed by this support object and given a time, it will return the applicable TemporalRecord for that time. The updateForTemporalRecord method allows this object to be extended to keep track of what happens to an object from the start of time, so that an object's status can be observed and calculated based on everything that might have changed in the TemporalRecord list before a given time.


Field Summary
static java.util.logging.Logger logger
           
protected  java.util.TreeSet<? extends TemporalRecord> temporals
           
 
Constructor Summary
TemporalSupport()
           
 
Method Summary
 void add(TemporalRecord tr)
           
 void clear()
           
abstract
<T extends TemporalRecord>
java.util.TreeSet<T>
createTemporalSet()
           
<T extends TemporalRecord>
T
getPosition(long time, boolean interpolate)
           
<T extends TemporalRecord>
java.util.TreeSet<T>
getTemporals()
           
protected  TemporalRecord interpolate(long time, TemporalRecord previous, TemporalRecord next)
          Just returns the TemporalRecord that is closes to the current time.
abstract
<T extends TemporalRecord>
java.util.Iterator<T>
iterator()
           
 boolean remove(TemporalRecord tr)
          Return true if the TemporalRecord was contained in the list.
<T extends TemporalRecord>
void
setTemporals(java.util.TreeSet<T> temporals)
           
protected  void updateForTemporal(long time, TemporalRecord temporal)
          Override this method to use the TemporalRecord's contents to affect the status of whatever you like.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger

temporals

protected java.util.TreeSet<? extends TemporalRecord> temporals
Constructor Detail

TemporalSupport

public TemporalSupport()
Method Detail

getPosition

public <T extends TemporalRecord> T getPosition(long time,
                                                boolean interpolate)
Parameters:
time - in milliseconds
interpolate - flag to signal that the returned Temporal object should be interpolated (in whatever way needed) if the time falls between Temporal objects.

updateForTemporal

protected void updateForTemporal(long time,
                                 TemporalRecord temporal)
Override this method to use the TemporalRecord's contents to affect the status of whatever you like.

Parameters:
time - milliseconds reflecting the current time.
temporal - record that reflects something that has happened.

interpolate

protected TemporalRecord interpolate(long time,
                                     TemporalRecord previous,
                                     TemporalRecord next)
Just returns the TemporalRecord that is closes to the current time. Assumes neither previous or next are null.

Parameters:
time - the current time.
previous - TemporalRecord that occurred before current time.
next - TemporalRecord that occurred after current time.
Returns:
closest one.

getTemporals

public <T extends TemporalRecord> java.util.TreeSet<T> getTemporals()

setTemporals

public <T extends TemporalRecord> void setTemporals(java.util.TreeSet<T> temporals)

createTemporalSet

public abstract <T extends TemporalRecord> java.util.TreeSet<T> createTemporalSet()

iterator

public abstract <T extends TemporalRecord> java.util.Iterator<T> iterator()

add

public void add(TemporalRecord tr)

remove

public boolean remove(TemporalRecord tr)
Return true if the TemporalRecord was contained in the list.

Parameters:
tr -
Returns:
true if removal was successful.

clear

public void clear()


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details