Esempio n. 1
0
  public List unwatchAndReturnAllWatched() {
    ArrayList arraylist = null;

    if (this.objectChanged) {
      this.lock.readLock().lock();
      Iterator iterator = this.watchedObjects.values().iterator();

      while (iterator.hasNext()) {
        WatchableObject watchableobject = (WatchableObject) iterator.next();

        if (watchableobject.isWatched()) {
          watchableobject.setWatched(false);

          if (arraylist == null) {
            arraylist = new ArrayList();
          }

          arraylist.add(watchableobject);
        }
      }

      this.lock.readLock().unlock();
    }

    this.objectChanged = false;
    return arraylist;
  }
Esempio n. 2
0
  public List unwatchAndReturnAllWatched() {
    ArrayList var1 = null;

    if (this.objectChanged) {
      this.field_75694_d.readLock().lock();
      Iterator var2 = this.watchedObjects.values().iterator();

      while (var2.hasNext()) {
        WatchableObject var3 = (WatchableObject) var2.next();

        if (var3.isWatched()) {
          var3.setWatched(false);

          if (var1 == null) {
            var1 = new ArrayList();
          }

          var1.add(var3);
        }
      }

      this.field_75694_d.readLock().unlock();
    }

    this.objectChanged = false;
    return var1;
  }
Esempio n. 3
0
  /** updates an already existing object */
  public void updateObject(int par1, Object par2Obj) {
    WatchableObject var3 = this.getWatchedObject(par1);

    if (!par2Obj.equals(var3.getObject())) {
      var3.setObject(par2Obj);
      var3.setWatched(true);
      this.objectChanged = true;
    }
  }
Esempio n. 4
0
  /** updates an already existing object */
  public void updateObject(int par1, Object par2Obj) {
    WatchableObject watchableobject = this.getWatchedObject(par1);

    if (!par2Obj.equals(watchableobject.getObject())) {
      watchableobject.setObject(par2Obj);
      watchableobject.setWatched(true);
      this.objectChanged = true;
    }
  }