org.jactr.core.utils.references
Class DefaultReferences

java.lang.Object
  extended by org.jactr.core.utils.references.DefaultReferences
All Implemented Interfaces:
IOptimizedReferences, IReferences

public class DefaultReferences
extends java.lang.Object
implements IOptimizedReferences


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jactr.core.utils.references.IReferences
IReferences.Factory
 
Constructor Summary
DefaultReferences()
          no optimization
DefaultReferences(int optimization)
           
 
Method Summary
 void addReferenceTime(double time)
          add a reference time and increment the reference count
 void clear()
          clear it out
 double getLastReferenceTime()
          get the last time there has been a reference
 long getNumberOfReferences()
          get the number of references.
 int getOptimizationLevel()
           
 double[] getRelativeTimes(double referenceTime)
          get all the reference times relative to referenceTime
 double[] getTimes()
          these may not be returned in order
 void removeReferenceTime(double time)
          remove a reference time and decrement the reference coutn
 void setNumberOfReferences(long references)
           
 void setOptimizationLevel(int level)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultReferences

public DefaultReferences()
no optimization


DefaultReferences

public DefaultReferences(int optimization)
Method Detail

addReferenceTime

public void addReferenceTime(double time)
Description copied from interface: IReferences
add a reference time and increment the reference count

Specified by:
addReferenceTime in interface IReferences

clear

public void clear()
Description copied from interface: IReferences
clear it out

Specified by:
clear in interface IReferences

getLastReferenceTime

public double getLastReferenceTime()
Description copied from interface: IReferences
get the last time there has been a reference

Specified by:
getLastReferenceTime in interface IReferences
Returns:

getNumberOfReferences

public long getNumberOfReferences()
Description copied from interface: IReferences
get the number of references. this value need not equal getTimes().size(), for instance getTimes() might just track a window of values and not every reference.

Specified by:
getNumberOfReferences in interface IReferences
Returns:

getRelativeTimes

public double[] getRelativeTimes(double referenceTime)
Description copied from interface: IReferences
get all the reference times relative to referenceTime

Specified by:
getRelativeTimes in interface IReferences
Returns:

getTimes

public double[] getTimes()
these may not be returned in order

Specified by:
getTimes in interface IReferences
Returns:
all the known absolute reference times
See Also:
IReferences.getTimes()

removeReferenceTime

public void removeReferenceTime(double time)
Description copied from interface: IReferences
remove a reference time and decrement the reference coutn

Specified by:
removeReferenceTime in interface IReferences

setNumberOfReferences

public void setNumberOfReferences(long references)
Specified by:
setNumberOfReferences in interface IReferences

getOptimizationLevel

public int getOptimizationLevel()
Specified by:
getOptimizationLevel in interface IOptimizedReferences

setOptimizationLevel

public final void setOptimizationLevel(int level)
Specified by:
setOptimizationLevel in interface IOptimizedReferences