Android Open Source - AerisAndroidLibrary My Places Subject

From Project

Back to project page AerisAndroidLibrary.


The source code is released under:

Apache License

If you think the Android project AerisAndroidLibrary listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.db;
/*  ww w  .  j a v a 2s.  co  m*/
import java.util.ArrayList;
import java.util.List;

public class MyPlacesSubject {

  public interface MyPlacesObserver {
    void notifyMyPlaceChanged(MyPlace place);

  private static MyPlacesSubject inst;
  private List<MyPlacesObserver> observers;
  public static MyPlacesSubject getInstance() {
    synchronized (MyPlacesSubject.class) {
      if (inst == null) {
        inst = new MyPlacesSubject();
      return inst;
  public void notifyObservers(MyPlace place) {
    if (observers != null) {
      for (MyPlacesObserver ob : observers) {
  public void registerObserver(MyPlacesObserver ob) {
    if (observers == null) {
      observers = new ArrayList<MyPlacesObserver>();

  public void unregisterObserver(MyPlacesObserver ob) {
    if (observers == null) {


Java Source Code List