Changeset 15317 in josm
- Timestamp:
- 2019-08-24T12:48:58+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
r15315 r15317 391 391 * Get keys that follow a regex 392 392 * @param env the environment 393 * @param key _regex the pattern that the key must match393 * @param keyRegex the pattern that the key must match 394 394 * @return the values for the keys that match the pattern 395 395 * @see Functions#tag_regex(Environment, String, String) 396 396 * @since 15315 397 397 */ 398 public static List<String> tag_regex(final Environment env, String key _regex) { // NO_UCD (unused code)399 return tag_regex(env, key _regex, "");398 public static List<String> tag_regex(final Environment env, String keyRegex) { // NO_UCD (unused code) 399 return tag_regex(env, keyRegex, ""); 400 400 } 401 401 … … 403 403 * Get keys that follow a regex 404 404 * @param env the environment 405 * @param key_regex the pattern that the key must match 405 * @param keyRegex the pattern that the key must match 406 * @param flags a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all") 406 407 * @return the values for the keys that match the pattern 407 * @param flags a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all")408 408 * @see Pattern#CASE_INSENSITIVE 409 409 * @see Pattern#DOTALL … … 411 411 * @since 15315 412 412 */ 413 public static List<String> tag_regex(final Environment env, String key _regex, String flags) { // NO_UCD (unused code)413 public static List<String> tag_regex(final Environment env, String keyRegex, String flags) { // NO_UCD (unused code) 414 414 int f = parse_regex_flags(flags); 415 Pattern compiled = Pattern.compile(key _regex, f);415 Pattern compiled = Pattern.compile(keyRegex, f); 416 416 return env.osm.getKeys().entrySet().stream() 417 417 .filter(object -> compiled.matcher(object.getKey()).find()) … … 422 422 * Parse flags for regex usage. Shouldn't be used in mapcss 423 423 * @param flags a string that may contain "i" (case insensitive), "m" (multiline) and "s" ("dot all") 424 * @return An int that can be used by a {@link Pattern} object 424 425 * @see Pattern#CASE_INSENSITIVE 425 426 * @see Pattern#DOTALL 426 427 * @see Pattern#MULTILINE 427 * @return An int that can be used by a {@link Pattern} object 428 */ 429 private static final int parse_regex_flags(String flags) { 428 */ 429 private static int parse_regex_flags(String flags) { 430 430 int f = 0; 431 431 if (flags.contains("i")) {
Note:
See TracChangeset
for help on using the changeset viewer.