public abstract class PrimaryBehavior extends AbstractBehavior
A primary behavior is responsible for the selection of input values for computing a result.
There must be one and only one primary behavior for each input (some transforms may supply a default).
Proxied.Abstract
Modifier and Type | Field and Description |
---|---|
static String |
AFTER_RESULT_SYNC_POSITION_PARAM
Specifies with a negative integer the maximum position in time after
which an input value should be selected, going back in the synchronized
history of the result point values.
|
static String |
FILTER_STAMP_TRIM_UNIT_PARAM
Specifies a default stamp trim unit for filtering.
|
static String |
FILTER_TIME_LIMIT_PARAM
Specifies a default time limit for filtering.
|
static String |
POLATOR_TIME_LIMIT_PARAM
Specifies a default time limit for interpolation or extrapolation.
|
static String |
SELECT_PREVIOUS_VALUE_PARAM
Selects the previous value of the corresponding point.
|
static String |
SELECT_SYNC_POSITION_PARAM
Specifies with a negative integer which value should be selected, going
back in the synchronized history of the input point values.
|
static String |
SINCE_RESULT_SYNC_POSITION_PARAM
Specifies with a zero or negative integer the maximum position in time
at which an input value should be selected, going back in the
synchronized history of the result point values.
|
static String |
SINCE_SYNC_POSITION_PARAM
Specifies with zero or a negative integer the maximum position at which
a value should be selected, going back in the synchronized history of the
input point values.
|
Constructor and Description |
---|
PrimaryBehavior() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addInputToResult(PointValue inputValue,
ResultValue resultValue)
Adds an input for computing the result.
|
boolean |
equals(Object other)
Extends comparison to the behaviors chain.
|
protected int |
getAfterResultSyncPosition()
Gets the 'AfterResultSyncPosition'.
|
protected Optional<Sync> |
getInputSync()
Gets the input specific sync.
|
protected Optional<Sync> |
getResultSync()
Gets the result sync.
|
protected Optional<DateTime> |
getResultSyncStamp(int position,
DateTime start,
boolean forward)
Gets a time stamp adjusted according to result sync position.
|
protected int |
getSelectSyncPosition()
Gets the 'SelectSyncPosition'.
|
protected int |
getSinceResultSyncPosition()
Gets the 'SinceResultSyncPosition'.
|
protected int |
getSinceSyncPosition()
Gets the 'SinceSyncPosition'.
|
Optional<Sync> |
getSync()
Gets the sync instance.
|
protected Optional<DateTime> |
getSynchronizedResultStamp(PointValue inputValue,
Batch batch)
Gets the synchronized result stamp.
|
protected Optional<DateTime> |
getSyncStamp(int position,
DateTime start,
boolean forward)
Gets a time stamp adjusted according to a sync position.
|
protected boolean |
hasAfterResultSyncPosition()
Asks if a 'AfterResultSyncPosition' is specified.
|
int |
hashCode() |
protected boolean |
hasSelectSyncPosition()
Asks if a 'SelectSyncPosition' is specified.
|
protected boolean |
hasSinceResultSyncPosition()
Asks if a 'SinceResultSyncPosition' is specified.
|
protected boolean |
hasSinceSyncPosition()
Asks if a 'SinceSyncPosition' is specified.
|
protected boolean |
isInSync(DateTime stamp)
Asks if the reference time stamp is in sync.
|
boolean |
isPrimary()
Asks if this behavior has primary responsibility.
|
protected boolean |
isSelectPreviousValue()
Asks if the previous value should be selected.
|
boolean |
prepareSelect(ResultValue resultValue,
Batch batch)
Allows a behavior to prepare for a call to
Behavior.select(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch) . |
boolean |
select(ResultValue resultValue,
Batch batch)
Selects input values for computing the result.
|
boolean |
setUp(Metadata metadata,
ProxyEntity proxyEntity)
Sets up the instance for action.
|
protected boolean |
supportsExtrapolated()
Asks if this behavior supports extrapolated values.
|
protected boolean |
supportsInterpolated()
Asks if this behavior supports interpolated values.
|
boolean |
validate()
Validates this behavior.
|
protected boolean |
validateNoLoop()
Validates that the point is not triggering itself.
|
protected boolean |
validateNotSynchronized()
Validates that the relation is not synchronized.
|
doValidate, getBehavior, getBooleanInputValue, getDoubleInputValue, getElapsedInputValue, getEntity, getInput, getInputPoint, getName, getNext, getParams, getProxyEntity, getRelation, getRelations, getRelationSync, getRelationSyncEntity, getResultPoint, getThisLogger, getTransform, isInherited, isInputExtrapolated, isInputInterpolated, isInputRequired, isInputValid, isResultFetched, isSynchronized, newResultValue, prepareTrigger, setInherited, setNext, setRelation, tearDown, toString, trigger, validateNoResults, validateTransform
public static final String AFTER_RESULT_SYNC_POSITION_PARAM
public static final String FILTER_STAMP_TRIM_UNIT_PARAM
public static final String FILTER_TIME_LIMIT_PARAM
public static final String POLATOR_TIME_LIMIT_PARAM
public static final String SELECT_PREVIOUS_VALUE_PARAM
public static final String SELECT_SYNC_POSITION_PARAM
public static final String SINCE_RESULT_SYNC_POSITION_PARAM
public static final String SINCE_SYNC_POSITION_PARAM
public boolean equals(Object other)
Extends comparison to the behaviors chain.
equals
in class AbstractBehavior
@Nonnull @CheckReturnValue public final Optional<Sync> getSync()
public int hashCode()
hashCode
in class AbstractBehavior
public final boolean isPrimary()
Primary responsibility invloves mainly the trigger logic.
isPrimary
in interface Behavior
isPrimary
in class AbstractBehavior
PrimaryBehavior
public boolean prepareSelect(ResultValue resultValue, Batch batch)
Behavior.select(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch)
.
The result value has been triggered either by this behavior or the behavior of an other input. Will be called until all the batch behaviors return true.
prepareSelect
in interface Behavior
prepareSelect
in class AbstractBehavior
resultValue
- The result value to be computed.batch
- The current batch context.public boolean select(ResultValue resultValue, Batch batch)
This is called after all the calls to the Behavior.prepareSelect(org.rvpf.base.value.ResultValue, org.rvpf.metadata.processor.Batch)
method have returned true.
select
in interface Behavior
select
in class AbstractBehavior
resultValue
- The result value to be computed.batch
- The current batch context.public boolean setUp(Metadata metadata, ProxyEntity proxyEntity)
setUp
in interface Proxied
setUp
in class AbstractBehavior
metadata
- The metadata available to the current process.proxyEntity
- The proxy entity refering to the proxied.public boolean validate()
validate
in interface Behavior
validate
in class AbstractBehavior
@CheckReturnValue protected final boolean addInputToResult(@Nonnull PointValue inputValue, @Nonnull ResultValue resultValue)
inputValue
- The input value.resultValue
- The result value.@CheckReturnValue protected final int getAfterResultSyncPosition()
@Nonnull @CheckReturnValue protected final Optional<Sync> getInputSync()
@Nonnull @CheckReturnValue protected final Optional<Sync> getResultSync()
@Nonnull @CheckReturnValue protected final Optional<DateTime> getResultSyncStamp(int position, @Nonnull DateTime start, boolean forward)
position
- The sync position.start
- The start time stamp.forward
- True for a forward adjustment.@CheckReturnValue protected final int getSelectSyncPosition()
@CheckReturnValue protected final int getSinceResultSyncPosition()
@CheckReturnValue protected final int getSinceSyncPosition()
@Nonnull @CheckReturnValue protected final Optional<DateTime> getSyncStamp(int position, @Nonnull DateTime start, boolean forward)
position
- The sync position.start
- The start time stamp.forward
- True for a forward adjustment.@Nonnull @CheckReturnValue protected final Optional<DateTime> getSynchronizedResultStamp(@Nonnull PointValue inputValue, @Nonnull Batch batch)
inputValue
- The result value that will be computed.batch
- The current batch context.@CheckReturnValue protected final boolean hasAfterResultSyncPosition()
@CheckReturnValue protected final boolean hasSelectSyncPosition()
@CheckReturnValue protected final boolean hasSinceResultSyncPosition()
@CheckReturnValue protected final boolean hasSinceSyncPosition()
@CheckReturnValue protected final boolean isInSync(@Nonnull DateTime stamp)
stamp
- The reference time stamp.@CheckReturnValue protected final boolean isSelectPreviousValue()
@CheckReturnValue protected boolean supportsExtrapolated()
@CheckReturnValue protected boolean supportsInterpolated()
@CheckReturnValue protected final boolean validateNoLoop()
@CheckReturnValue protected final boolean validateNotSynchronized()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.