IT. Expert System.

Android Reference

Observable


java.util

Class Observable

  • Direct Known Subclasses:
    ContentQueryMap


    public class Observable
    extends Object
    Observable is used to notify a group of Observer objects when a change occurs. On creation, the set of observers is empty. After a change occurred, the application can call the notifyObservers() method. This will cause the invocation of the update() method of all registered Observers. The order of invocation is not specified. This implementation will call the Observers in the order they registered. Subclasses are completely free in what order they call the update methods.
    See Also:
    Observer
    • Constructor Summary

      Constructors
      Constructor and Description
      Observable()
      Constructs a new Observable object.
    • Constructor Detail

      • Observable

        public Observable()
        Constructs a new Observable object.
    • Method Detail

      • addObserver

        public void addObserver(Observer observer)
        Adds the specified observer to the list of observers. If it is already registered, it is not added a second time.
        Parameters:
        observer - the Observer to add.
      • clearChanged

        protected void clearChanged()
        Clears the changed flag for this Observable. After calling clearChanged(), hasChanged() will return false.
      • countObservers

        public int countObservers()
        Returns the number of observers registered to this Observable.
        Returns:
        the number of observers.
      • deleteObserver

        public void deleteObserver(Observer observer)
        Removes the specified observer from the list of observers. Passing null won't do anything.
        Parameters:
        observer - the observer to remove.
      • deleteObservers

        public void deleteObservers()
        Removes all observers from the list of observers.
      • hasChanged

        public boolean hasChanged()
        Returns the changed flag for this Observable.
        Returns:
        true when the changed flag for this Observable is set, false otherwise.
      • notifyObservers

        public void notifyObservers()
        If hasChanged() returns true, calls the update() method for every observer in the list of observers using null as the argument. Afterwards, calls clearChanged().

        Equivalent to calling notifyObservers(null).

      • notifyObservers

        public void notifyObservers(Object data)
        If hasChanged() returns true, calls the update() method for every Observer in the list of observers using the specified argument. Afterwards calls clearChanged().
        Parameters:
        data - the argument passed to update().
      • setChanged

        protected void setChanged()
        Sets the changed flag for this Observable. After calling setChanged(), hasChanged() will return true.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1764 / . Delta: 0.01707 с