Class StandardListenerManager<T>

    • Method Detail

      • standard

        public static <T> StandardListenerManager<T> standard()
        Returns a new standard listener container
        Returns:
        new container
      • mappingStandard

        public static <T> StandardListenerManager<T> mappingStandard​(UnaryOperator<T> mapper)
        Returns a new mapping container that maps to the same type
        Parameters:
        mapper - listener mapper/wrapper
        Returns:
        new container
      • addListener

        public void addListener​(T listener)
        Description copied from interface: Listenable
        Add the given listener. The listener will be executed in the containing instance's thread.
        Specified by:
        addListener in interface Listenable<T>
        Parameters:
        listener - listener to add
      • addListener

        public void addListener​(T listener,
                                Executor executor)
        Description copied from interface: Listenable
        Add the given listener. The listener will be executed using the given executor
        Specified by:
        addListener in interface Listenable<T>
        Parameters:
        listener - listener to add
        executor - executor to run listener in
      • removeListener

        public void removeListener​(T listener)
        Description copied from interface: Listenable
        Remove the given listener
        Specified by:
        removeListener in interface Listenable<T>
        Parameters:
        listener - listener to remove
      • size

        public int size()
        Description copied from interface: ListenerManager
        Return the number of listeners
        Specified by:
        size in interface ListenerManager<T,​T>
        Returns:
        number
      • forEach

        public void forEach​(Consumer<T> function)
        Description copied from interface: ListenerManager
        Utility - apply the given function to each listener. The function receives the listener as an argument.
        Specified by:
        forEach in interface ListenerManager<T,​T>
        Parameters:
        function - function to call for each listener