Class AbstractFilterWrapper<T>
java.lang.Object
com.fluxtion.ext.streaming.api.stream.AbstractFilterWrapper<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
FilterWrapper<T>
,Stateful<T>
,Test
,Wrapper<T>
- Direct Known Subclasses:
DefaultNumberWrapper
public abstract class AbstractFilterWrapper<T> extends java.lang.Object implements FilterWrapper<T>
A base class for stream functions.
- Author:
- V12 Technology Ltd.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fluxtion.ext.streaming.api.Stateful
Stateful.StatefulNumber<S>
-
Field Summary
Fields Modifier and Type Field Description protected boolean
notifyOnChangeOnly
java.lang.Object
publishThenResetNotifier
protected boolean
recalculate
protected boolean
reset
java.lang.Object
resetNoPublishNotifier
java.lang.Object
resetThenPublishNotifier
protected boolean
result
protected boolean
validOnStart
-
Constructor Summary
Constructors Constructor Description AbstractFilterWrapper()
-
Method Summary
Modifier and Type Method Description boolean
isNotifyOnChangeOnly()
boolean
isValidOnStart()
FilterWrapper<T>
notifyOnChange(boolean notifyOnChange)
Controls the notification policy of event notification to child nodes for this stream node.boolean
passed()
FilterWrapper<T>
publishAndReset(java.lang.Object notifier)
Publishes the current value to all child dependencies and then resets.void
publishThenResehNotification(java.lang.Object publishThenResetNotifier)
FilterWrapper<T>
resetAndPublish(java.lang.Object notifier)
Resets the stateful node and publishes the current value by notifying child nodes.FilterWrapper<T>
resetNoPublish(java.lang.Object notifier)
Resets the current value without notifying children of a change.void
resetNoPublishNotification(java.lang.Object resetNoPublishNotifier)
void
resetThenPublishNotification(java.lang.Object resetThenPublishNotifier)
void
setNotifyOnChangeOnly(boolean notifyOnChangeOnly)
void
setValidOnStart(boolean validOnStart)
FilterWrapper<T>
validOnStart(boolean validOnStart)
Set this property to signal the wrapper has a valid value and child nodes do not have to wait for a trigger notification before using the data from this instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.fluxtion.ext.streaming.api.FilterWrapper
elseStream, forEach, forEach, id, push
Methods inherited from interface com.fluxtion.ext.streaming.api.Stateful
combine, deduct, setBucketCount
-
Field Details
-
notifyOnChangeOnly
protected boolean notifyOnChangeOnly -
validOnStart
protected boolean validOnStart -
result
protected boolean result -
publishThenResetNotifier
public java.lang.Object publishThenResetNotifier -
resetThenPublishNotifier
public java.lang.Object resetThenPublishNotifier -
resetNoPublishNotifier
public java.lang.Object resetNoPublishNotifier -
recalculate
protected boolean recalculate -
reset
protected boolean reset
-
-
Constructor Details
-
AbstractFilterWrapper
public AbstractFilterWrapper()
-
-
Method Details
-
publishAndReset
Description copied from interface:Wrapper
Publishes the current value to all child dependencies and then resets. After all children have processed the trigger a reset is invoked on the wrapped instance. The publish and reset is triggered when the supplied notifier triggers in the execution graph.- Specified by:
publishAndReset
in interfaceWrapper<T>
- Parameters:
notifier
- trigger for publish and reset- Returns:
-
resetAndPublish
Description copied from interface:Wrapper
Resets the stateful node and publishes the current value by notifying child nodes. The reset is before the notification is broadcast. The reset and publish is triggered when the supplied notifier triggers in the execution graph.- Specified by:
resetAndPublish
in interfaceWrapper<T>
- Parameters:
notifier
- trigger for reset and publish- Returns:
-
resetNoPublish
Description copied from interface:Wrapper
Resets the current value without notifying children of a change. The reset is triggered when the supplied notifier triggers in the execution graph.- Specified by:
resetNoPublish
in interfaceWrapper<T>
- Parameters:
notifier
- trigger for reset- Returns:
-
publishThenResehNotification
public void publishThenResehNotification(java.lang.Object publishThenResetNotifier) -
resetThenPublishNotification
public void resetThenPublishNotification(java.lang.Object resetThenPublishNotifier) -
resetNoPublishNotification
public void resetNoPublishNotification(java.lang.Object resetNoPublishNotifier) -
notifyOnChange
Description copied from interface:Wrapper
Controls the notification policy of event notification to child nodes for this stream node. The default policy is to invoke child nodes when the return of the parent event method is true. NotifyOnChange notifies the child only when the parent node return of the previous cycle is false and this one is true.This can be useful if a single notification of a breach is required and subsequent continued breaches are swallowed, for example this can prevent logging spamming when combined with filters.
- Specified by:
notifyOnChange
in interfaceFilterWrapper<T>
- Specified by:
notifyOnChange
in interfaceWrapper<T>
- Parameters:
notifyOnChange
- false = notify always. true = notify on change only- Returns:
- The current node
-
validOnStart
Description copied from interface:Wrapper
Set this property to signal the wrapper has a valid value and child nodes do not have to wait for a trigger notification before using the data from this instance.- Specified by:
validOnStart
in interfaceFilterWrapper<T>
- Specified by:
validOnStart
in interfaceWrapper<T>
- Returns:
-
isNotifyOnChangeOnly
public boolean isNotifyOnChangeOnly() -
setNotifyOnChangeOnly
public void setNotifyOnChangeOnly(boolean notifyOnChangeOnly) -
isValidOnStart
public boolean isValidOnStart()- Specified by:
isValidOnStart
in interfaceWrapper<T>
-
setValidOnStart
public void setValidOnStart(boolean validOnStart) -
passed
public boolean passed()
-