Code example for Stack

0
    } 
  } 
 
  // stores list of photos to download 
  class PhotosQueue { 
    private final Stack<PhotoToLoad> photosToLoad = new Stack<PhotoToLoad>();
 
    // removes all instances of this ImageView 
    public void Clean(ImageView image) {
      synchronized (photosToLoad) {
        for (int j = 0; j < photosToLoad.size(); ) {
          if (photosToLoad.get(j).imageView == image) photosToLoad.remove(j);
          else ++j;
        } 
      } 
    } 
  } 
 
  // Task for the queue 
  private class PhotoToLoad { 
    public int uid;