Class Notifications

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class Notifications
    extends Data
    A container class that stores all the notifications that need to be done indexed by the various conditions.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.EnumMap<Invoke.WHEN,​java.util.List<Invoke>> mInvokeMap
      An enum map that associates the various notification events with the list of actions that need to be taken.
    • Constructor Summary

      Constructors 
      Constructor Description
      Notifications()
      The default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Invoke notification)
      Adds a Invoke object correpsonding to a notification.
      void addAll​(Notifications notifications)
      Adds all the notifications passed to the underlying container.
      private void addAll​(Invoke.WHEN when, java.util.Collection<Invoke> invokes)
      Convenience method at add all the notifications corresponding to a particular event
      java.lang.Object clone()
      Returns the clone of the object.
      java.util.Collection<Invoke> getNotifications​(Invoke.WHEN when)
      Returns a collection of all the notifications that need to be done for a particular condition
      boolean isEmpty()
      Returns a boolean indicating whether the notifications object is empty or not.
      void reset()
      Resets the internal invoke map.
      java.lang.String toString()
      Returns a String description of the object
      • Methods inherited from class java.lang.Object

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

      • mInvokeMap

        private java.util.EnumMap<Invoke.WHEN,​java.util.List<Invoke>> mInvokeMap
        An enum map that associates the various notification events with the list of actions that need to be taken.
    • Constructor Detail

      • Notifications

        public Notifications()
        The default constructor.
    • Method Detail

      • reset

        public void reset()
        Resets the internal invoke map.
      • add

        public void add​(Invoke notification)
        Adds a Invoke object correpsonding to a notification.
        Parameters:
        notification - the notification object
      • addAll

        public void addAll​(Notifications notifications)
        Adds all the notifications passed to the underlying container.
        Parameters:
        notifications - the notification object
      • getNotifications

        public java.util.Collection<Invoke> getNotifications​(Invoke.WHEN when)
        Returns a collection of all the notifications that need to be done for a particular condition
        Parameters:
        when - the condition
        Returns:
      • isEmpty

        public boolean isEmpty()
        Returns a boolean indicating whether the notifications object is empty or not.
        Returns:
        true if empty else false
      • clone

        public java.lang.Object clone()
        Returns the clone of the object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        the clone
      • toString

        public java.lang.String toString()
        Returns a String description of the object
        Specified by:
        toString in class Data
        Returns:
      • addAll

        private void addAll​(Invoke.WHEN when,
                            java.util.Collection<Invoke> invokes)
        Convenience method at add all the notifications corresponding to a particular event
        Parameters:
        when - when does the event happen
        notifications - the list of notificiations