1 package tim.prune.save.xml;
3 import tim.prune.data.DataPoint;
4 import tim.prune.data.FileInfo;
5 import tim.prune.data.SourceInfo;
8 * Class to hold a list of GpxCacher objects
9 * and get the original source xml for data points
11 public class GpxCacherList
13 /** Array of Gpx Cachers */
14 private GpxCacher[] _cacherList = null;
18 * @param inInfo file info object
20 public GpxCacherList(FileInfo inInfo)
22 int numFiles = inInfo.getNumFiles();
23 _cacherList = new GpxCacher[numFiles];
24 for (int i=0; i<numFiles; i++) {
25 SourceInfo info = inInfo.getSource(i);
26 if (info.getFileType() == SourceInfo.FILE_TYPE.GPX) {
27 _cacherList[i] = new GpxCacher(info);
33 * Get the source for the given data point
34 * @param inPoint point to look for
35 * @return source string or null if not found
37 public String getSourceString(DataPoint inPoint)
41 for (int i=0; i<_cacherList.length && (str == null); i++) {
42 GpxCacher cacher = _cacherList[i];
44 str = cacher.getSourceString(inPoint);
51 * @return the first non-empty header from the list
53 public String getFirstHeader()
57 for (int i=0; i<_cacherList.length && (str == null || str.equals("")); i++)
59 GpxCacher cacher = _cacherList[i];
61 str = cacher.getHeaderString();