Class stl_ListenerPool<T>

java.lang.Object
com.jackmeng.stl.stl_ListenerPool<T>

public class stl_ListenerPool<T>
extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.util.List<stl_Listener<T>> listeners  
    private java.lang.String name  
  • Constructor Summary

    Constructors
    Constructor Description
    stl_ListenerPool​(java.lang.String poolName)  
  • Method Summary

    Modifier and Type Method Description
    void add​(stl_Listener<T> listener)  
    void dispatch​(T payload)
    It is highly suggested that you make sure that the payload is not null!
    void kill()  
    java.lang.String name()  
    void name​(java.lang.String name)  
    void rmf​(stl_Listener<T> listener)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      private java.lang.String name
    • listeners

      private final java.util.List<stl_Listener<T>> listeners
  • Constructor Details

    • stl_ListenerPool

      public stl_ListenerPool​(java.lang.String poolName)
  • Method Details

    • name

      public java.lang.String name()
    • name

      public void name​(java.lang.String name)
    • add

      public void add​(stl_Listener<T> listener)
    • rmf

      public void rmf​(stl_Listener<T> listener)
    • kill

      public void kill()
    • dispatch

      public void dispatch​(T payload)
      It is highly suggested that you make sure that the payload is not null!
      Parameters:
      payload - The action to dispatch to all the listeners
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object