コード例 #1
0
ファイル: Id.java プロジェクト: Richie12138/COMP529
  /**
   * Method which performs the coalescing and interaction with the weak hash map
   *
   * @param id The Id to coalesce
   * @return The Id to use
   */
  protected static Id resolve(WeakHashMap map, Id id) {
    synchronized (map) {
      WeakReference ref = (WeakReference) map.get(id);
      Id result = null;

      if ((ref != null) && ((result = (Id) ref.get()) != null)) {
        return result;
      } else {
        map.put(id, new WeakReference(id));
        return id;
      }
    }
  }
コード例 #2
0
 private ImageView getImageView() {
   return mImageView.get();
 }