Code example for Vector

Methods: add, contains

0
    } 
 
    private static class QueueItem { 
        private String imageName;
 
        private Vector<ImageDownloadListener> listeners = new Vector<ImageDownloadListener>();
 
        public QueueItem(String imageName) {
            this.imageName = imageName;
        } 
         
        private void notifyListeners(Bitmap origBitmap) {
            for (ImageDownloadListener listener : this.listeners) {
                listener.onImageDownloaded(origBitmap, this.imageName);
            } 
        } 
 
        public void addListener(ImageDownloadListener listener) {
            if (!this.listeners.contains(listener)) {
                this.listeners.add(listener);
            } 
        } 
    } 
}