Class Observing


  • public class Observing
    extends Object
    INTERNAL USE ONLY --- NOT part of the official API This class globally collects all running observations and tracks the created events.
    • Method Detail

      • setStopOnFirstEvent

        public static void setStopOnFirstEvent()
        tell the next starting observer, to stop on the first event
      • getStopOnFirstEvent

        public static boolean getStopOnFirstEvent()
      • addRunningObserver

        public static void addRunningObserver​(Region r)
      • removeRunningObserver

        public static void removeRunningObserver​(Region r)
      • setInactive

        public void setInactive​(String name)
        set the observer with the given name inactive (not checked while observing)
        Parameters:
        name -
      • setActive

        public void setActive​(String name)
        set the observer with the given name active (checked while observing)
        Parameters:
        name -
      • setActive

        public static void setActive​(String name,
                                     boolean state)
      • remove

        public static void remove​(String name)
        remove the observer from the list, a region observer will be stopped
        events for that observer are removed as well
        Parameters:
        name - name of observer
      • remove

        public static void remove​(Region reg)
        stop and remove all observers registered for this region from the list
        events for those observers are removed as well
        Parameters:
        reg -
      • cleanUp

        public static void cleanUp()
        stop and remove all observers and their registered events
      • hasEvents

        public static boolean hasEvents()
        are their any happened events
        Returns:
        true if yes
      • hasEvents

        public static boolean hasEvents​(Region reg)
        are their any happened events for this region?
        Parameters:
        reg -
        Returns:
        true if yes
      • hasEvent

        public static boolean hasEvent​(String name)
        are their any happened events for the observer having this name?
        Parameters:
        name -
        Returns:
        true if yes
      • addEvent

        public static void addEvent​(ObserveEvent evt)
      • getEvents

        public static ObserveEvent[] getEvents​(Region reg)
        return the events for that region
        events are removed from the list
        Parameters:
        reg -
        Returns:
        the array of events or size 0 array if none
      • getEvents

        public static ObserveEvent[] getEvents()
        return all events (they are preserved)
        Returns:
        the array of events or size 0 array if none
      • getEvent

        public static ObserveEvent getEvent​(String name)
        retrieves and removes the requested event
        Parameters:
        name - of event
        Returns:
        the event or null
      • clearEvents

        public static void clearEvents()
        the event list is purged