Class ModificationListenerAdapter

  • All Implemented Interfaces:
    ModificationListener

    public abstract class ModificationListenerAdapter
    extends java.lang.Object
    implements ModificationListener
    A modification listener adapter.
    Author:
    harald
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String[] getNames()
      Gets the names to listen to.
      int getPriority()
      Gets the execution priority.
      Determines the order of execution.
      long getTimeDelay()
      Gets the optional delay to fire the event.
      Allows to collect events for multiple names within an interval.
      If both timeFrame and timeDelay are given, the delay is treated as an offset to the frame.
      long getTimeFrame()
      Gets the optional execution time frame in milliseconds.
      If given, the listener will be executed at a random time within the time frame.
      • Methods inherited from class java.lang.Object

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

      • ModificationListenerAdapter

        public ModificationListenerAdapter​(java.lang.String... names)
        Creates a listener for the given modification names.
        Parameters:
        names - the names, null if any modification
      • ModificationListenerAdapter

        public ModificationListenerAdapter()
        Creates a listener for any modification.
    • Method Detail

      • getNames

        public java.lang.String[] getNames()
        Description copied from interface: ModificationListener
        Gets the names to listen to.
        Specified by:
        getNames in interface ModificationListener
        Returns:
        the modification names, null if listen for any change
      • getPriority

        public int getPriority()
        Description copied from interface: ModificationListener
        Gets the execution priority.
        Determines the order of execution. Lower priority comes first.
        Specified by:
        getPriority in interface ModificationListener
        Returns:
        the execution priority
      • getTimeFrame

        public long getTimeFrame()
        Description copied from interface: ModificationListener
        Gets the optional execution time frame in milliseconds.
        If given, the listener will be executed at a random time within the time frame. The priority will have no effect in such a case.
        The same listener is only fired once even if the corresponding event occurs again before the listener gets invoked.
        Specified by:
        getTimeFrame in interface ModificationListener
        Returns:
        the execution time window
      • getTimeDelay

        public long getTimeDelay()
        Description copied from interface: ModificationListener
        Gets the optional delay to fire the event.
        Allows to collect events for multiple names within an interval.
        If both timeFrame and timeDelay are given, the delay is treated as an offset to the frame.
        Specified by:
        getTimeDelay in interface ModificationListener
        Returns:
        the delay in milliseconds, 0 if no delay