X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FSourceInfo.java;h=5e40eee953e1f31bd7c7755a8201665810215b7c;hb=0a2480df5845e2d7190dfdec9b2653b1609e853d;hp=341bf0299410a3f767adcf9fbe9f3064d9053aef;hpb=140e9d165f85c3d4f0435a311e091209313faa2a;p=GpsPrune.git diff --git a/tim/prune/data/SourceInfo.java b/tim/prune/data/SourceInfo.java index 341bf02..5e40eee 100644 --- a/tim/prune/data/SourceInfo.java +++ b/tim/prune/data/SourceInfo.java @@ -9,7 +9,7 @@ import java.io.File; public class SourceInfo { /** File type of source file */ - public enum FILE_TYPE {TEXT, GPX, KML, NMEA, GPSBABEL, GPSIES}; + public enum FILE_TYPE {TEXT, GPX, KML, NMEA, GPSBABEL, GPSIES, JSON}; /** Source file */ private File _sourceFile = null; @@ -122,9 +122,14 @@ public class SourceInfo public int getIndex(DataPoint inPoint) { int idx = -1; - for (int i=0; i<_points.length && (idx < 0); i++) { - if (_points[i] == inPoint) {idx = i;} + for (int i=0; i<_points.length; i++) + { + if (_points[i] == inPoint) { + idx = i; + break; + } } + if (idx == -1) {return idx;} // point not found if (_pointIndices == null) {return idx;} // All points loaded return _pointIndices[idx]; // use point index mapping }