java.lang.Object
javafx.beans.binding.ObjectExpression<T>
javafx.beans.binding.ObjectBinding<T>
com.iamsoft.util.ui.javafx.collections.reduction.MeanBinding<T>
Type Parameters:
T - Item type.
All Implemented Interfaces:
javafx.beans.binding.Binding<T>, javafx.beans.Observable, javafx.beans.value.ObservableObjectValue<T>, javafx.beans.value.ObservableValue<T>

public class MeanBinding<T> extends javafx.beans.binding.ObjectBinding<T>
Averages items in a list.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    MeanBinding(javafx.collections.ObservableList<? extends T> pList, BinaryOperator<T> pAddFunction, BiFunction<T,Integer,? extends T> pDivideFunction)
    Fully recalculate after each change.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected T
     
    static <T> T
    computeValue(Collection<? extends T> pCollection, BinaryOperator<T> pAddFunction, BiFunction<T,Integer,? extends T> pDivideFunction)
     

    Methods inherited from class javafx.beans.binding.ObjectBinding

    addListener, addListener, allowValidation, bind, dispose, get, getDependencies, invalidate, isObserved, isValid, onInvalidating, removeListener, removeListener, toString, unbind

    Methods inherited from class javafx.beans.binding.ObjectExpression

    asString, asString, asString, getValue, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull, objectExpression

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javafx.beans.value.ObservableValue

    flatMap, getValue, map, orElse, when
  • Constructor Details

    • MeanBinding

      public MeanBinding(javafx.collections.ObservableList<? extends T> pList, BinaryOperator<T> pAddFunction, BiFunction<T,Integer,? extends T> pDivideFunction)
      Fully recalculate after each change.
  • Method Details

    • computeValue

      protected T computeValue()
      Specified by:
      computeValue in class javafx.beans.binding.ObjectBinding<T>
    • computeValue

      public static <T> T computeValue(Collection<? extends T> pCollection, BinaryOperator<T> pAddFunction, BiFunction<T,Integer,? extends T> pDivideFunction)