Add method that returns all images of a Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 27 Sep 2011 19:13:32 +0000 (21:13 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 27 Sep 2011 19:13:32 +0000 (21:13 +0200)
src/main/java/net/pterodactylus/sone/data/Sone.java

index aad50e5..be3a660 100644 (file)
@@ -666,6 +666,20 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        }
 
        /**
+        * Returns all images of a Sone. Images of a album are inserted into this
+        * list before images of all child albums.
+        *
+        * @return The list of all images
+        */
+       public List<Image> getAllImages() {
+               List<Image> allImages = new ArrayList<Image>();
+               for (Album album : getAllAlbums()) {
+                       allImages.addAll(album.getImages());
+               }
+               return allImages;
+       }
+
+       /**
         * Adds an album to this Sone.
         *
         * @param album