java.lang.Object
javafx.beans.binding.ObjectExpression<T>
javafx.beans.binding.ObjectBinding<T>
com.iamsoft.util.ui.javafx.collections.reduction.SumBinding<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 SumBinding<T> extends javafx.beans.binding.ObjectBinding<T>
Sums items in a list.
See Also:
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    protected T
     
    static <T> T
    computeValue(Iterable<? extends T> pIterable, T pIdentity, BinaryOperator<T> pAddFunction)
     
    static <T> T
    computeValue(Iterator<? extends T> pIterator, T pIdentity, BinaryOperator<T> pAddFunction)
     

    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

    • SumBinding

      public SumBinding(javafx.collections.ObservableList<? extends T> pList, T pIdentity, BinaryOperator<T> pAddFunction)
      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(Iterable<? extends T> pIterable, T pIdentity, BinaryOperator<T> pAddFunction)
    • computeValue

      public static <T> T computeValue(Iterator<? extends T> pIterator, T pIdentity, BinaryOperator<T> pAddFunction)