Changeset 14436 in josm for trunk/src/org
- Timestamp:
- 2018-11-20T02:07:07+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r14397 r14436 93 93 * @return ImageryInfo object that's ready to be used to create TileSource 94 94 */ 95 private ImageryInfo convertImagery(ImageryInfo info) {95 private static ImageryInfo convertImagery(ImageryInfo info) { 96 96 try { 97 97 switch(info.getImageryType()) { -
trunk/src/org/openstreetmap/josm/data/imagery/AbstractWMSTileSource.java
r14403 r14436 231 231 } 232 232 233 private String getBboxstr(double x1, double x2, double x3, double x4) {233 private static String getBboxstr(double x1, double x2, double x3, double x4) { 234 234 return new StringBuilder(64) 235 235 .append(LATLON_FORMAT.format(x1)) -
trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java
r13901 r14436 6 6 import java.net.URL; 7 7 import java.util.Locale; 8 import java.util.function.Bi Function;8 import java.util.function.BiPredicate; 9 9 10 10 import javax.xml.namespace.QName; … … 167 167 */ 168 168 public static boolean moveReaderToTag(XMLStreamReader reader, 169 Bi Function<QName, QName, Boolean> equalsFunc, QName... tags) throws XMLStreamException {169 BiPredicate<QName, QName> equalsFunc, QName... tags) throws XMLStreamException { 170 170 QName stopTag = reader.getName(); 171 171 int currentLevel = 0; … … 175 175 176 176 for (int event = 0; //skip current element, so we will not skip it as a whole 177 reader.hasNext() && !(event == XMLStreamReader.END_ELEMENT && equalsFunc. apply(stopTag, reader.getName()));177 reader.hasNext() && !(event == XMLStreamReader.END_ELEMENT && equalsFunc.test(stopTag, reader.getName())); 178 178 event = reader.next()) { 179 if (event == XMLStreamReader.END_ELEMENT && skipTag != null && equalsFunc. apply(skipTag, reader.getName())) {179 if (event == XMLStreamReader.END_ELEMENT && skipTag != null && equalsFunc.test(skipTag, reader.getName())) { 180 180 skipTag = null; 181 181 } 182 182 if (skipTag == null) { 183 183 if (event == XMLStreamReader.START_ELEMENT) { 184 if (equalsFunc. apply(searchTag, reader.getName())) {184 if (equalsFunc.test(searchTag, reader.getName())) { 185 185 currentLevel += 1; 186 186 if (currentLevel >= tags.length) { … … 194 194 } 195 195 196 if (event == XMLStreamReader.END_ELEMENT && parentTag != null && equalsFunc. apply(parentTag, reader.getName())) {196 if (event == XMLStreamReader.END_ELEMENT && parentTag != null && equalsFunc.test(parentTag, reader.getName())) { 197 197 currentLevel -= 1; 198 198 searchTag = parentTag; -
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java
r13649 r14436 70 70 * @return the intersection result for a2 and a1 71 71 */ 72 private PolygonIntersection getReverseIntersectionResult(PolygonIntersection intersection) {72 private static PolygonIntersection getReverseIntersectionResult(PolygonIntersection intersection) { 73 73 switch (intersection) { 74 74 case FIRST_INSIDE_SECOND: -
trunk/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java
r14435 r14436 14 14 import java.util.Arrays; 15 15 import java.util.List; 16 import java.util.function. Function;16 import java.util.function.ToDoubleFunction; 17 17 18 18 import org.openstreetmap.josm.cli.CLIModule; … … 166 166 } 167 167 168 private EastNorth parseEastNorth(String s, Function<String, Double> parser) {168 private EastNorth parseEastNorth(String s, ToDoubleFunction<String> parser) { 169 169 String[] en = s.split("[;, ]+"); 170 170 if (en.length != 2) 171 171 throw new IllegalArgumentException(tr("Expected two coordinates, separated by white space, found {0} in ''{1}''", en.length, s)); 172 double east = parser.apply (en[0]);173 double north = parser.apply (en[1]);172 double east = parser.applyAsDouble(en[0]); 173 double north = parser.applyAsDouble(en[1]); 174 174 if (this.argSwitchInput) 175 175 return new EastNorth(north, east); -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r14408 r14436 316 316 * @return true if one or more ways are in the set of known ways 317 317 */ 318 private boolean hasIntersectionWay(PolyData pd, Set<Way> intersectionWays) {318 private static boolean hasIntersectionWay(PolyData pd, Set<Way> intersectionWays) { 319 319 for (Way w : intersectionWays) { 320 320 if (pd.getWayIds().contains(w.getUniqueId())) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r14273 r14436 150 150 } 151 151 152 private boolean checkMemberType(Role r, RelationMember member) {152 private static boolean checkMemberType(Role r, RelationMember member) { 153 153 if (r.types != null) { 154 154 switch (member.getDisplayType()) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
r14214 r14436 9 9 import java.util.Objects; 10 10 import java.util.Set; 11 import java.util.function.Bi Function;11 import java.util.function.BiPredicate; 12 12 import java.util.function.IntFunction; 13 13 import java.util.function.Predicate; … … 181 181 static final Set<Op> NEGATED_OPS = EnumSet.of(NEQ, NREGEX); 182 182 183 private final Bi Function<String, String, Boolean> function;183 private final BiPredicate<String, String> function; 184 184 185 185 private final boolean negated; … … 189 189 * @param func The function to apply during {@link #eval(String, String)}. 190 190 */ 191 Op(Bi Function<String, String, Boolean> func) {191 Op(BiPredicate<String, String> func) { 192 192 this.function = func; 193 193 negated = false; … … 219 219 */ 220 220 Op(Op negate) { 221 this.function = (a, b) -> !negate.function. apply(a, b);221 this.function = (a, b) -> !negate.function.test(a, b); 222 222 negated = true; 223 223 } … … 233 233 return negated; 234 234 else 235 return function. apply(testString, prototypeString);235 return function.test(testString, prototypeString); 236 236 } 237 237 } -
trunk/src/org/openstreetmap/josm/io/NoteReader.java
r14101 r14436 11 11 import java.util.Locale; 12 12 import java.util.Optional; 13 import java.util.function. Function;13 import java.util.function.UnaryOperator; 14 14 15 15 import javax.xml.parsers.ParserConfigurationException; … … 176 176 } 177 177 178 static LatLon parseLatLon( Function<String,String> attrs) {178 static LatLon parseLatLon(UnaryOperator<String> attrs) { 179 179 double lat = Double.parseDouble(attrs.apply("lat")); 180 180 double lon = Double.parseDouble(attrs.apply("lon")); … … 186 186 } 187 187 188 static Note parseNoteBasic( Function<String,String> attrs) {188 static Note parseNoteBasic(UnaryOperator<String> attrs) { 189 189 return new Note(parseLatLon(attrs)); 190 190 } … … 194 194 } 195 195 196 static Note parseNoteFull( Function<String,String> attrs) {196 static Note parseNoteFull(UnaryOperator<String> attrs) { 197 197 Note note = parseNoteBasic(attrs); 198 198 String id = attrs.apply("id"); -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r14121 r14436 21 21 import java.util.Map; 22 22 import java.util.function.Consumer; 23 import java.util.function. Function;23 import java.util.function.UnaryOperator; 24 24 25 25 import javax.xml.parsers.ParserConfigurationException; … … 367 367 368 368 private void individualPrimitiveModification(String method, String verb, IPrimitive osm, ProgressMonitor monitor, 369 Consumer<String> consumer, Function<String,String> errHandler) throws OsmTransferException {369 Consumer<String> consumer, UnaryOperator<String> errHandler) throws OsmTransferException { 370 370 String ret = ""; 371 371 try { -
trunk/src/org/openstreetmap/josm/tools/HiDPISupport.java
r13849 r14436 15 15 import java.util.Optional; 16 16 import java.util.function.Function; 17 import java.util.function.UnaryOperator; 17 18 import java.util.stream.Collectors; 18 19 import java.util.stream.IntStream; … … 170 171 * for each resolution variant 171 172 */ 172 public static Image processMRImage(Image img, Function<Image,Image> processor) {173 public static Image processMRImage(Image img, UnaryOperator<Image> processor) { 173 174 return processMRImages(Collections.singletonList(img), imgs -> processor.apply(imgs.get(0))); 174 175 }
Note:
See TracChangeset
for help on using the changeset viewer.