Class CompoundRTIndicator
java.lang.Object
com.wualabs.qtsurfer.engine.indicators.core.AbstractRTIndicator
com.wualabs.qtsurfer.engine.indicators.helpers.group.CompoundRTIndicator
- All Implemented Interfaces:
ClockAware, Resettable, RTIndicator
Inmutable Compound RT Indicator
-
Constructor Summary
ConstructorsConstructorDescriptionCompoundRTIndicator(int indexValue, @NonNull RTIndicator... indicators) CompoundRTIndicator(int indexValue, @NonNull List<RTIndicator> indicators) CompoundRTIndicator(@NonNull List<RTIndicator> indicators) -
Method Summary
Modifier and TypeMethodDescription<T extends RTIndicator>
TgetIndicator(int index) static CompoundRTIndicatorof(@NonNull RTIndicator... indicators) static CompoundRTIndicatorof(@NonNull Collection<RTIndicator> indicators) voidreset()voidsetClockSupplier(@NonNull Supplier<Clock> clockSupplier) doubleupdate(double newValue) Fans out the input value to all child indicators, then returns the value from the indicator atindexValueposition (if set), or falls back to the raw input value.withIndexValue(int indexValue) Methods inherited from class AbstractRTIndicator
equals, getDisplayHint, getMeta, getValue, hashCode, hide, isPoison, setValue, toString, toString, withDisplayHint, withMeta
-
Constructor Details
-
CompoundRTIndicator
-
CompoundRTIndicator
-
CompoundRTIndicator
-
-
Method Details
-
of
-
of
-
withIndexValue
-
getIndicator
-
setClockSupplier
- Specified by:
setClockSupplierin interfaceClockAware
-
reset
public void reset()- Specified by:
resetin interfaceResettable- Overrides:
resetin classAbstractRTIndicator
-
update
public double update(double newValue) Fans out the input value to all child indicators, then returns the value from the indicator atindexValueposition (if set), or falls back to the raw input value. This enables updating multiple indicators atomically while extracting the result from a specific one.- Specified by:
updatein interfaceRTIndicator- Overrides:
updatein classAbstractRTIndicator- Parameters:
newValue- the input value forwarded to all child indicators- Returns:
- the value from the selected indicator, or the raw input
-