Class Ref.Input<T>

  • Type Parameters:
    T - type of references
    Enclosing class:
    Ref<T>

    public abstract static class Ref.Input<T>
    extends Object
    A field type for Ref input ports. Can be used with In or AuxIn annotations.
    • Constructor Detail

      • Input

        protected Input()
    • Method Detail

      • values

        public List<T> values()
        Current list of connected values. This list contains the values from all connected Refs that have initialized and non-null values.
        Returns:
        list of connected values
      • onUpdate

        public Linkable<List<T>> onUpdate()
        Returns a new Linkable for reacting to updates in the list of values. The Linkable will also be called immediately on addition with the existing values.
        Returns:
        linkable for values changes
      • onUpdate

        public Ref.Input onUpdate​(Consumer<List<T>> consumer)
        Connect a consumer for reacting to updates in the list of values. The consumer will also be called immediately on addition with the existing values.

        This method is a shorthand for calling onUpdate().link(consumer).

        Parameters:
        consumer - consumer called on updates
        Returns:
        this
      • update

        protected void update​(List<Ref<T>> refs)