Class ContextAttribute


  • public abstract class ContextAttribute
    extends java.lang.Object
    This is an abstract base class for context attributes. A context attribute includes a name and a value. It can also be related to one or more context sources, and the value of the attribute may be determined by the sources (i.e. sensors or other data sources).
    • Constructor Detail

      • ContextAttribute

        public ContextAttribute​(java.lang.String attributeName)
        Creates an context attribute
        Parameters:
        attributeName - the name of this context attribute
    • Method Detail

      • getName

        public java.lang.String getName()
        Gets name of a context attribute
        Returns:
        the name of this attribute
      • getValue

        public abstract java.lang.Object getValue()
        Gets value of this context attribute. This is an abstract method that should be implemented by the upper classes.
        Returns:
        the value of this attribute
      • getContextSources

        public java.util.Iterator<ContextSource> getContextSources()
        Gets all the context sources
        Returns:
        the context sources
      • addContextSource

        public void addContextSource​(ContextSource source)
        Adds a new context source
        Parameters:
        source - the context source
      • removeContextSource

        public void removeContextSource​(ContextSource source)
        Removes a context source
        Parameters:
        source - the context source