Class RMListenerList

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    RMObject

    public class RMListenerList
    extends java.lang.Object
    implements java.lang.Cloneable
    A class that holds a list of instances for given class.
    • Constructor Summary

      Constructors 
      Constructor Description
      RMListenerList()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> void addListener​(java.lang.Class<T> aClass, T aListener)
      Adds the listener as a listener of the specified type.
      java.lang.Object clone()
      Standard clone implementation.
      <T> T getListener​(java.lang.Class<T> aClass, int anIndex)
      Returns the given listener at index.
      int getListenerCount()
      Returns the total number of listeners for this listener list.
      int getListenerCount​(java.lang.Class<?> aClass)
      Returns the total number of listeners of the supplied type for this listener list.
      java.lang.Object[] getListenerList()
      Returns the actual array of listeners.
      <T> T[] getListeners​(java.lang.Class<T> aClass)
      Return an array of all the listeners of the given type.
      boolean hasListeners()
      Returns whether this obejct has listeners.
      <T> void removeListener​(java.lang.Class<T> aClass, T aListener)
      Removes the listener as a listener of the specified type.
      java.lang.String toString()
      Returns a string representation of the EventListenerList.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RMListenerList

        public RMListenerList()
    • Method Detail

      • getListenerList

        public java.lang.Object[] getListenerList()
        Returns the actual array of listeners.
      • getListener

        public <T> T getListener​(java.lang.Class<T> aClass,
                                 int anIndex)
        Returns the given listener at index.
      • getListeners

        public <T> T[] getListeners​(java.lang.Class<T> aClass)
        Return an array of all the listeners of the given type.
      • hasListeners

        public boolean hasListeners()
        Returns whether this obejct has listeners.
      • getListenerCount

        public int getListenerCount()
        Returns the total number of listeners for this listener list.
      • getListenerCount

        public int getListenerCount​(java.lang.Class<?> aClass)
        Returns the total number of listeners of the supplied type for this listener list.
      • addListener

        public <T> void addListener​(java.lang.Class<T> aClass,
                                    T aListener)
        Adds the listener as a listener of the specified type.
      • removeListener

        public <T> void removeListener​(java.lang.Class<T> aClass,
                                       T aListener)
        Removes the listener as a listener of the specified type.
        Parameters:
        aClass - the type of the listener to be removed
        aListener - the listener to be removed
      • clone

        @Nonnull
        public java.lang.Object clone()
        Standard clone implementation.
        Overrides:
        clone in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns a string representation of the EventListenerList.
        Overrides:
        toString in class java.lang.Object