Class ContextNot

  • All Implemented Interfaces:
    ContextListener

    public class ContextNot
    extends Context
    implements ContextListener
    This class is defined by an other context and this context is active when the related context is inactive (NOT operation). The class extends the base class Context.
    The context active value is updated using the setActive method. The current value of the context can always be checked using the isActive method of the context.
    If the application needs to track the changes in the active value of the context then the application should implement also the ContextListener interface {@see eu.h2020.helios_social.core.context.ContextListener} and register the context for the listener.
    • Constructor Detail

      • ContextNot

        public ContextNot​(java.lang.String name,
                          @NonNull
                          Context context)
        Creates a ContextNot context
        Parameters:
        name - the name of the context
        context - the related context
      • ContextNot

        public ContextNot​(java.lang.String id,
                          java.lang.String name,
                          @NonNull
                          Context context)
        Creates a ContextNot context
        Parameters:
        id - the identifier of the context
        name - the name of the context
        context - the related context
    • Method Detail

      • getContextNot

        public Context getContextNot()
        Returns the related context of this
        Returns:
        the context
      • contextChanged

        public void contextChanged​(boolean active)
        Description copied from interface: ContextListener
        This method is called when context active value changed.
        Specified by:
        contextChanged in interface ContextListener
        Parameters:
        active - the context active value