Changeset 35240 in osm for applications/editors/josm/plugins/indoorhelper/src/model
- Timestamp:
- 2019-11-30T18:25:05+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/indoorhelper/src/model/IndoorLevel.java
r34734 r35240 19 19 package model; 20 20 21 import java.util.regex.Matcher; 22 import java.util.regex.Pattern; 23 21 24 import org.openstreetmap.josm.data.osm.Tag; 22 25 … … 30 33 31 34 public class IndoorLevel { 35 36 private static final Pattern RANGE = Pattern.compile("(-?[0-9]+)-(-?[0-9]+)"); 32 37 33 38 private Tag levelNumberTag; … … 119 124 for (String val : vals.split(";")) { 120 125 int firstVal, secVal; 126 Matcher m = RANGE.matcher(val); 121 127 122 128 //Extract values 123 if (val.indexOf("-") == 0) { 124 firstVal = Integer.parseInt(val.split("-", 2)[1].split("-", 2)[0])*-1; 125 secVal = Integer.parseInt(val.split("-", 2)[1].split("-", 2)[1]); 126 } else if (val.contains("-")) { 127 firstVal = Integer.parseInt(val.split("-")[0]); 128 secVal = Integer.parseInt(val.split("-")[1]); 129 if (m.matches()) { 130 firstVal = Integer.parseInt(m.group(1)); 131 secVal = Integer.parseInt(m.group(2)); 129 132 } else { 130 133 firstVal = Integer.parseInt(val);
Note:
See TracChangeset
for help on using the changeset viewer.