- public void removeCorrelatedPhotos()
- {
- int numPhotos = getNumPhotos();
- if (numPhotos > 0)
- {
- // Construct new list to copy into
- ArrayList<Photo> listCopy = new ArrayList<Photo>();
- // Loop over photos in list
- for (int i=0; i<numPhotos; i++)
- {
- // Copy photo if it has no point
- Photo photo = getPhoto(i);
- if (photo != null)
- {
- if (photo.getDataPoint() == null)
- listCopy.add(photo);
- else
- photo.resetCachedData();
- }
- }
- // Switch reference to new list
- _photos = listCopy;
- }
- }
-
-
- /**
- * @return clone of photo list contents
- */
- public PhotoList cloneList()
- {
- if (_photos == null) return this;
- ArrayList<Photo> listCopy = new ArrayList<Photo>();
- for (int i=0; i<_photos.size(); i++) {
- listCopy.add(_photos.get(i));
- }
- return new PhotoList(listCopy);
- }
-
-
- /**
- * Restore contents from other PhotoList
- * @param inOther PhotoList with cloned contents
- */
- public void restore(PhotoList inOther)
- {
- if (inOther.getNumPhotos() == 0)
- {
- // List is empty
- _photos = null;
- }
- else
- {
- // Clear array and copy over from other one
- _photos.clear();
- _photos.addAll(inOther._photos);
- }