X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FPhotoList.java;h=18ebe15d179d9f174d2d9ddc8dd1947098c9b10c;hp=b7c044da5ad2295b2bd98d677fc1c1a84d1aca2d;hb=54b9d8bc8f0025ccf97a67d9dd217ef1f9cf082f;hpb=52bf9e8686c916be37a26a0b75340393d4478b05 diff --git a/tim/prune/data/PhotoList.java b/tim/prune/data/PhotoList.java index b7c044d..18ebe15 100644 --- a/tim/prune/data/PhotoList.java +++ b/tim/prune/data/PhotoList.java @@ -7,7 +7,7 @@ import java.util.ArrayList; */ public class PhotoList { - private ArrayList _photos = null; + private ArrayList _photos = null; /** * Empty constructor @@ -21,7 +21,7 @@ public class PhotoList * Constructor * @param inList ArrayList containing Photo objects */ - private PhotoList(ArrayList inList) + private PhotoList(ArrayList inList) { _photos = inList; } @@ -48,7 +48,7 @@ public class PhotoList // Make sure array is initialised if (_photos == null) { - _photos = new ArrayList(); + _photos = new ArrayList(); } // Add the photo _photos.add(inPhoto); @@ -68,7 +68,7 @@ public class PhotoList // Make sure array is initialised if (_photos == null) { - _photos = new ArrayList(); + _photos = new ArrayList(); } // Add the photo _photos.add(inIndex, inPhoto); @@ -135,7 +135,7 @@ public class PhotoList public Photo getPhoto(int inIndex) { if (inIndex < 0 || inIndex >= getNumPhotos()) return null; - return (Photo) _photos.get(inIndex); + return _photos.get(inIndex); } @@ -201,7 +201,7 @@ public class PhotoList if (numPhotos > 0) { // Construct new list to copy into - ArrayList listCopy = new ArrayList(); + ArrayList listCopy = new ArrayList(); // Loop over photos in list for (int i=0; i listCopy = new ArrayList(); + for (int i=0; i<_photos.size(); i++) { + listCopy.add(_photos.get(i)); + } + return new PhotoList(listCopy); }