public abstract class LinkDelayEvaluator extends Evaluator<Duration>
Modifier | Constructor and Description |
---|---|
protected |
LinkDelayEvaluator(EvaluatorGroup group)
Initializes a new instance.
|
protected |
LinkDelayEvaluator(LinkDelayEvaluator existingInstance,
CopyContext context)
Initializes a new instance as a copy of an existing instance.
|
Modifier and Type | Method and Description |
---|---|
JulianDate |
adjustDate(JulianDate date,
boolean remember)
Adjusts a date according to the link delay.
|
TimeInterval |
adjustInterval(TimeInterval interval,
boolean remember)
Adjusts an interval according to the link delay.
|
TimeIntervalCollection |
adjustIntervals(TimeIntervalCollection intervals,
boolean remember)
Adjusts an interval collection according to the link delay.
|
Duration |
evaluateAndRemember(JulianDate date)
Evaluates the link delay and remembers it so that it can later be reversed.
|
abstract TimeIntervalCollection |
getAvailability(TimeIntervalCollection consideredIntervals,
TimeIntervalCollection finalPointAvailability)
Computes the intervals when this evaluator is available given the intervals when the final point
is available.
|
IEvaluator |
getCachingWrapper()
Gets a version of this evaluator that caches the previously computed value so that if it is evaluated
twice at the same date the computation is done only once.
|
void |
popAdjustmentCache()
Pops the topmost set of cached adjustments off the stack.
|
IDisposable |
pushAdjustmentCache()
Pushes the a set of cached adjustments onto the stack.
|
clone, dispose, dispose, evaluate, evaluate, evaluate, evaluate, evaluate, getAvailabilityIntervals, getAvailabilityIntervals, getGroup, getIsThreadSafe, getIsTimeVarying, isAvailable, updateEvaluatorReferences
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
protected LinkDelayEvaluator(@Nonnull EvaluatorGroup group)
group
- The group that contains this evaluator.ArgumentNullException
- Thrown when group
is null
.protected LinkDelayEvaluator(@Nonnull LinkDelayEvaluator existingInstance, @Nonnull CopyContext context)
See ICloneWithContext.clone(CopyContext)
for more information about how to implement this constructor
in a derived class.
existingInstance
- The existing instance to copy.context
- A CopyContext
that controls the depth of the copy.ArgumentNullException
- Thrown when existingInstance
or context
is null
.public IEvaluator getCachingWrapper()
This method is called by EvaluatorGroup
to create a caching version of an evaluator
that is shared between multiple computations.
To implement this method in your own evaluator, construct and return a caching version of the evaluator's base class.
For example, if your evaluator implements IEvaluator1
directly, return an instance of
CachingEvaluator
. In many cases, such as when implementing a PointEvaluator
this method does not need to be overridden because the default implementation returns an appropriate
caching wrapper already. If you do not want the last value computed by your evaluator to ever be cached, or
if your evaluator does its own caching internally, this method can return this
.
Shows an example implementation in an evaluator that implements IEvaluator1
directly, where T is double.
@Override
public IEvaluator getCachingWrapper() {
return new CachingEvaluator<Double>(this);
}
getCachingWrapper
in interface IEvaluator
getCachingWrapper
in class Evaluator<Duration>
this
should be returned by this method.@Nonnull public abstract TimeIntervalCollection getAvailability(@Nonnull TimeIntervalCollection consideredIntervals, @Nonnull TimeIntervalCollection finalPointAvailability)
consideredIntervals
- The intervals over which availability information is needed. Note that the returned availability
intervals may indicate availability outside of these intervals of consideration.finalPointAvailability
- The intervals when the final point is available. These intervals are expressed on the final point.@Nonnull public Duration evaluateAndRemember(@Nonnull JulianDate date)
date
- The date at which to evaluate the link delay.@Nonnull public final JulianDate adjustDate(@Nonnull JulianDate date, boolean remember)
date
- The date to adjust.remember
- true
if this adjustment should be remembered so that it can be reversed
without loss of precision. false
if this adjustment will not be reversed.@Nonnull public final TimeInterval adjustInterval(@Nonnull TimeInterval interval, boolean remember)
interval
- The interval to adjust.remember
- true
if this adjustment should be remembered so that it can be reversed
without loss of precision. false
if this adjustment will not be reversed.@Nonnull public final TimeIntervalCollection adjustIntervals(@Nonnull TimeIntervalCollection intervals, boolean remember)
intervals
- The intervals to adjust.remember
- true
if this adjustment should be remembered so that it can be reversed
without loss of precision. false
if this adjustment will not be reversed.@Nonnull public IDisposable pushAdjustmentCache()
public void popAdjustmentCache()