Changeset 17765 in josm for trunk/src/org
- Timestamp:
- 2021-04-13T13:26:03+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
r17762 r17765 721 721 * @return {@code true} if the way is closed or the relation is a closed multipolygon 722 722 */ 723 static boolean closed(Environment e) { // NO_UCD (unused code)723 static boolean closed(Environment e) { 724 724 if (e.osm instanceof IWay<?> && ((IWay<?>) e.osm).isClosed()) 725 725 return true; … … 733 733 * @see IPrimitive#isModified() 734 734 */ 735 static boolean modified(Environment e) { // NO_UCD (unused code)735 static boolean modified(Environment e) { 736 736 return e.osm.isModified() || e.osm.isNewOrUndeleted(); 737 737 } … … 743 743 * @see IPrimitive#isNew() 744 744 */ 745 static boolean _new(Environment e) { // NO_UCD (unused code)745 static boolean _new(Environment e) { 746 746 return e.osm.isNew(); 747 747 } … … 753 753 * @see Node#isConnectionNode() 754 754 */ 755 static boolean connection(Environment e) { // NO_UCD (unused code)755 static boolean connection(Environment e) { 756 756 return e.osm instanceof INode && e.osm.getDataSet() != null && ((INode) e.osm).isConnectionNode(); 757 757 } … … 763 763 * @see IPrimitive#isTagged() 764 764 */ 765 static boolean tagged(Environment e) { // NO_UCD (unused code)765 static boolean tagged(Environment e) { 766 766 return e.osm.isTagged(); 767 767 } … … 773 773 * @see IPrimitive#hasSameInterestingTags(IPrimitive) 774 774 */ 775 static boolean sameTags(Environment e) { // NO_UCD (unused code)775 static boolean sameTags(Environment e) { 776 776 return e.osm.hasSameInterestingTags(Utils.firstNonNull(e.child, e.parent)); 777 777 } … … 783 783 * @see ElemStyles#hasAreaElemStyle(IPrimitive, boolean) 784 784 */ 785 static boolean areaStyle(Environment e) { // NO_UCD (unused code)785 static boolean areaStyle(Environment e) { 786 786 // only for validator 787 787 return ElemStyles.hasAreaElemStyle(e.osm, false); … … 793 793 * @return {@code true} if the object is a unconnected node 794 794 */ 795 static boolean unconnected(Environment e) { // NO_UCD (unused code)795 static boolean unconnected(Environment e) { 796 796 return e.osm instanceof Node && ((Node) e.osm).getParentWays().isEmpty(); 797 797 } … … 803 803 * @see Functions#is_right_hand_traffic(Environment) 804 804 */ 805 static boolean righthandtraffic(Environment e) { // NO_UCD (unused code)805 static boolean righthandtraffic(Environment e) { 806 806 return Functions.is_right_hand_traffic(e); 807 807 } … … 814 814 * @see Functions#is_clockwise(Environment) 815 815 */ 816 static boolean clockwise(Environment e) { // NO_UCD (unused code)816 static boolean clockwise(Environment e) { 817 817 return Functions.is_clockwise(e); 818 818 } … … 825 825 * @see Functions#is_anticlockwise(Environment) 826 826 */ 827 static boolean anticlockwise(Environment e) { // NO_UCD (unused code)827 static boolean anticlockwise(Environment e) { 828 828 return Functions.is_anticlockwise(e); 829 829 } … … 834 834 * @return {@code true} if the object is an unclosed multipolygon 835 835 */ 836 static boolean unclosed_multipolygon(Environment e) { // NO_UCD (unused code)836 static boolean unclosed_multipolygon(Environment e) { 837 837 return e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && 838 838 !e.osm.isIncomplete() && !((Relation) e.osm).hasIncompleteMembers() && … … 848 848 * @see InDataSourceArea 849 849 */ 850 static boolean inDownloadedArea(Environment e) { // NO_UCD (unused code)850 static boolean inDownloadedArea(Environment e) { 851 851 return e.osm instanceof OsmPrimitive && IN_DOWNLOADED_AREA.test((OsmPrimitive) e.osm); 852 852 } 853 853 854 static boolean completely_downloaded(Environment e) { // NO_UCD (unused code)854 static boolean completely_downloaded(Environment e) { 855 855 if (e.osm instanceof IRelation<?>) { 856 856 return !((IRelation<?>) e.osm).hasIncompleteMembers(); … … 860 860 } 861 861 862 static boolean closed2(Environment e) { // NO_UCD (unused code)862 static boolean closed2(Environment e) { 863 863 if (e.osm instanceof IWay<?> && ((IWay<?>) e.osm).isClosed()) 864 864 return true; … … 870 870 } 871 871 872 static boolean selected(Environment e) { // NO_UCD (unused code)872 static boolean selected(Environment e) { 873 873 if (e.mc != null) { 874 874 e.getCascade().setDefaultSelectedHandling(false); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.java
r17759 r17765 66 66 * @return {@code o} unchanged 67 67 */ 68 public static Object eval(Object o) { // NO_UCD (unused code)68 public static Object eval(Object o) { 69 69 return o; 70 70 } … … 77 77 * @see Float#sum 78 78 */ 79 public static double plus(double a, double b) { // NO_UCD (unused code)79 public static double plus(double a, double b) { 80 80 return a + b; 81 81 } … … 87 87 * @return Subtraction of arguments 88 88 */ 89 public static double minus(double a, double b) { // NO_UCD (unused code)89 public static double minus(double a, double b) { 90 90 return a - b; 91 91 } … … 97 97 * @return Multiplication of arguments 98 98 */ 99 public static double times(double a, double b) { // NO_UCD (unused code)99 public static double times(double a, double b) { 100 100 return a * b; 101 101 } … … 107 107 * @return Division of arguments 108 108 */ 109 public static double divided_by(double a, double b) { // NO_UCD (unused code)109 public static double divided_by(double a, double b) { 110 110 return a / b; 111 111 } … … 117 117 * @return {@code a mod b}, e.g., {@code mod(7, 5) = 2} 118 118 */ 119 public static float mod(float a, float b) { // NO_UCD (unused code)119 public static float mod(float a, float b) { 120 120 return a % b; 121 121 } … … 128 128 * @see Arrays#asList(Object[]) 129 129 */ 130 public static List<Object> list(Environment ignored, Object... args) { // NO_UCD (unused code)130 public static List<Object> list(Environment ignored, Object... args) { 131 131 return Arrays.asList(args); 132 132 } … … 137 137 * @return length of the list 138 138 */ 139 public static Integer count(List<?> lst) { // NO_UCD (unused code)139 public static Integer count(List<?> lst) { 140 140 return lst.size(); 141 141 } … … 150 150 */ 151 151 @NullableArguments 152 public static Object any(Environment ignored, Object... args) { // NO_UCD (unused code)152 public static Object any(Environment ignored, Object... args) { 153 153 return Utils.firstNonNull(args); 154 154 } … … 161 161 * @since 5699 162 162 */ 163 public static Object get(List<?> lst, float n) { // NO_UCD (unused code)163 public static Object get(List<?> lst, float n) { 164 164 int idx = Math.round(n); 165 165 if (idx >= 0 && idx < lst.size()) { … … 177 177 * @since 5699 178 178 */ 179 public static List<String> split(String sep, String toSplit) { // NO_UCD (unused code)179 public static List<String> split(String sep, String toSplit) { 180 180 return Arrays.asList(toSplit.split(Pattern.quote(sep), -1)); 181 181 } … … 189 189 * @see Color#Color(float, float, float) 190 190 */ 191 public static Color rgb(float r, float g, float b) { // NO_UCD (unused code)191 public static Color rgb(float r, float g, float b) { 192 192 try { 193 193 return new Color(r, g, b); … … 208 208 * @see Color#Color(float, float, float, float) 209 209 */ 210 public static Color rgba(float r, float g, float b, float alpha) { // NO_UCD (unused code)210 public static Color rgba(float r, float g, float b, float alpha) { 211 211 try { 212 212 return new Color(r, g, b, alpha); … … 224 224 * @return the corresponding color 225 225 */ 226 public static Color hsb_color(float h, float s, float b) { // NO_UCD (unused code)226 public static Color hsb_color(float h, float s, float b) { 227 227 try { 228 228 return Color.getHSBColor(h, s, b); … … 238 238 * @return color matching the given notation 239 239 */ 240 public static Color html2color(String html) { // NO_UCD (unused code)240 public static Color html2color(String html) { 241 241 return ColorHelper.html2color(html); 242 242 } … … 247 247 * @return HTML notation matching the given color 248 248 */ 249 public static String color2html(Color c) { // NO_UCD (unused code)249 public static String color2html(Color c) { 250 250 return ColorHelper.color2html(c); 251 251 } … … 257 257 * @see java.awt.Color#getRed() 258 258 */ 259 public static float red(Color c) { // NO_UCD (unused code)259 public static float red(Color c) { 260 260 return ColorHelper.int2float(c.getRed()); 261 261 } … … 267 267 * @see java.awt.Color#getGreen() 268 268 */ 269 public static float green(Color c) { // NO_UCD (unused code)269 public static float green(Color c) { 270 270 return ColorHelper.int2float(c.getGreen()); 271 271 } … … 277 277 * @see java.awt.Color#getBlue() 278 278 */ 279 public static float blue(Color c) { // NO_UCD (unused code)279 public static float blue(Color c) { 280 280 return ColorHelper.int2float(c.getBlue()); 281 281 } … … 287 287 * @see java.awt.Color#getAlpha() 288 288 */ 289 public static float alpha(Color c) { // NO_UCD (unused code)289 public static float alpha(Color c) { 290 290 return ColorHelper.int2float(c.getAlpha()); 291 291 } … … 299 299 */ 300 300 @NullableArguments 301 public static String concat(Environment ignored, Object... args) { // NO_UCD (unused code)301 public static String concat(Environment ignored, Object... args) { 302 302 return Arrays.stream(args) 303 303 .filter(Objects::nonNull) … … 314 314 */ 315 315 @NullableArguments 316 public static String join(Environment ignored, String... args) { // NO_UCD (unused code)316 public static String join(Environment ignored, String... args) { 317 317 return String.join(args[0], Arrays.asList(args).subList(1, args.length)); 318 318 } … … 325 325 * @see String#join 326 326 */ 327 public static String join_list(final String separator, final List<String> values) { // NO_UCD (unused code)327 public static String join_list(final String separator, final List<String> values) { 328 328 return String.join(separator, values); 329 329 } … … 335 335 * @return the property value 336 336 */ 337 public static Object prop(final Environment env, String key) { // NO_UCD (unused code)337 public static Object prop(final Environment env, String key) { 338 338 return prop(env, key, null); 339 339 } … … 356 356 * @return {@code true} if the property is set, {@code false} otherwise 357 357 */ 358 public static Boolean is_prop_set(final Environment env, String key) { // NO_UCD (unused code)358 public static Boolean is_prop_set(final Environment env, String key) { 359 359 return is_prop_set(env, key, null); 360 360 } … … 377 377 * @return the value for given key 378 378 */ 379 public static String tag(final Environment env, String key) { // NO_UCD (unused code)379 public static String tag(final Environment env, String key) { 380 380 return env.osm == null ? null : env.osm.get(key); 381 381 } … … 389 389 * @since 15315 390 390 */ 391 public static List<String> tag_regex(final Environment env, String keyRegex) { // NO_UCD (unused code)391 public static List<String> tag_regex(final Environment env, String keyRegex) { 392 392 return tag_regex(env, keyRegex, ""); 393 393 } … … 404 404 * @since 15315 405 405 */ 406 public static List<String> tag_regex(final Environment env, String keyRegex, String flags) { // NO_UCD (unused code)406 public static List<String> tag_regex(final Environment env, String keyRegex, String flags) { 407 407 int f = parse_regex_flags(flags); 408 408 Pattern compiled = Pattern.compile(keyRegex, f); … … 440 440 * @return first non-null value of the key {@code key} from the object's parent(s) 441 441 */ 442 public static String parent_tag(final Environment env, String key) { // NO_UCD (unused code)442 public static String parent_tag(final Environment env, String key) { 443 443 if (env.parent == null) { 444 444 if (env.osm != null) { … … 462 462 * @return a list of non-null values of the key {@code key} from the object's parent(s) 463 463 */ 464 public static List<String> parent_tags(final Environment env, String key) { // NO_UCD (unused code)464 public static List<String> parent_tags(final Environment env, String key) { 465 465 if (env.parent == null) { 466 466 if (env.osm != null) { … … 483 483 * @return the value of the key {@code key} from the object's child, or {@code null} if there is no child 484 484 */ 485 public static String child_tag(final Environment env, String key) { // NO_UCD (unused code)485 public static String child_tag(final Environment env, String key) { 486 486 return env.child == null ? null : env.child.get(key); 487 487 } … … 495 495 * @see IPrimitive#getUniqueId() 496 496 */ 497 public static Long parent_osm_id(final Environment env) { // NO_UCD (unused code)497 public static Long parent_osm_id(final Environment env) { 498 498 return env.parent == null ? null : env.parent.getUniqueId(); 499 499 } … … 506 506 * @since 14802 507 507 */ 508 public static double gpx_distance(final Environment env) { // NO_UCD (unused code)508 public static double gpx_distance(final Environment env) { 509 509 if (env.osm instanceof OsmPrimitive) { 510 510 return MainApplication.getLayerManager().getAllGpxData().stream() … … 521 521 * @return {@code true} if the object has a tag with the given key, {@code false} otherwise 522 522 */ 523 public static boolean has_tag_key(final Environment env, String key) { // NO_UCD (unused code)523 public static boolean has_tag_key(final Environment env, String key) { 524 524 return env.osm.hasKey(key); 525 525 } … … 530 530 * @return the index as float. Starts at 1 531 531 */ 532 public static Float index(final Environment env) { // NO_UCD (unused code)532 public static Float index(final Environment env) { 533 533 if (env.index == null) { 534 534 return null; … … 544 544 * @since 15279 545 545 */ 546 public static List<String> sort(Environment ignored, String... sortables) { // NO_UCD (unused code)546 public static List<String> sort(Environment ignored, String... sortables) { 547 547 Arrays.parallelSort(sortables); 548 548 return Arrays.asList(sortables); … … 555 555 * @since 15279 556 556 */ 557 public static List<String> sort_list(List<String> sortables) { // NO_UCD (unused code)557 public static List<String> sort_list(List<String> sortables) { 558 558 Collections.sort(sortables); 559 559 return sortables; … … 567 567 * @since 15323 568 568 */ 569 public static List<String> uniq(Environment ignored, String... values) { // NO_UCD (unused code)569 public static List<String> uniq(Environment ignored, String... values) { 570 570 return uniq_list(Arrays.asList(values)); 571 571 } … … 587 587 * @see Environment#getRole() 588 588 */ 589 public static String role(final Environment env) { // NO_UCD (unused code)589 public static String role(final Environment env) { 590 590 return env.getRole(); 591 591 } … … 598 598 * @since 15196 599 599 */ 600 public static int count_roles(final Environment env, String... roles) { // NO_UCD (unused code)600 public static int count_roles(final Environment env, String... roles) { 601 601 int rValue = 0; 602 602 if (env.osm instanceof Relation) { … … 616 616 * @see Geometry#computeArea(IPrimitive) 617 617 */ 618 public static Float areasize(final Environment env) { // NO_UCD (unused code)618 public static Float areasize(final Environment env) { 619 619 final Double area = Geometry.computeArea(env.osm); 620 620 return area == null ? null : area.floatValue(); … … 627 627 * @see Way#getLength() 628 628 */ 629 public static Float waylength(final Environment env) { // NO_UCD (unused code)629 public static Float waylength(final Environment env) { 630 630 if (env.osm instanceof Way) { 631 631 return (float) ((Way) env.osm).getLength(); … … 640 640 * @return {@code true} if {@code !b} 641 641 */ 642 public static boolean not(boolean b) { // NO_UCD (unused code)642 public static boolean not(boolean b) { 643 643 return !b; 644 644 } … … 650 650 * @return {@code true} if {@code a >= b} 651 651 */ 652 public static boolean greater_equal(float a, float b) { // NO_UCD (unused code)652 public static boolean greater_equal(float a, float b) { 653 653 return a >= b; 654 654 } … … 660 660 * @return {@code true} if {@code a <= b} 661 661 */ 662 public static boolean less_equal(float a, float b) { // NO_UCD (unused code)662 public static boolean less_equal(float a, float b) { 663 663 return a <= b; 664 664 } … … 670 670 * @return {@code true} if {@code a > b} 671 671 */ 672 public static boolean greater(float a, float b) { // NO_UCD (unused code)672 public static boolean greater(float a, float b) { 673 673 return a > b; 674 674 } … … 680 680 * @return {@code true} if {@code a < b} 681 681 */ 682 public static boolean less(float a, float b) { // NO_UCD (unused code)682 public static boolean less(float a, float b) { 683 683 return a < b; 684 684 } … … 690 690 * @see Math#toRadians(double) 691 691 */ 692 public static double degree_to_radians(double degree) { // NO_UCD (unused code)692 public static double degree_to_radians(double degree) { 693 693 return Utils.toRadians(degree); 694 694 } … … 703 703 * @see RotationAngle#parseCardinalRotation(String) 704 704 */ 705 public static Double cardinal_to_radians(String cardinal) { // NO_UCD (unused code)705 public static Double cardinal_to_radians(String cardinal) { 706 706 try { 707 707 return RotationAngle.parseCardinalRotation(cardinal); … … 732 732 * @see Object#equals(Object) 733 733 */ 734 public static boolean not_equal(Object a, Object b) { // NO_UCD (unused code)734 public static boolean not_equal(Object a, Object b) { 735 735 return !equal(a, b); 736 736 } … … 743 743 * @see SearchCompiler 744 744 */ 745 public static Boolean JOSM_search(final Environment env, String searchStr) { // NO_UCD (unused code)745 public static Boolean JOSM_search(final Environment env, String searchStr) { 746 746 Match m; 747 747 try { … … 766 766 * @return value for key, or default value if not found 767 767 */ 768 public static String JOSM_pref(Environment env, String key, String def) { // NO_UCD (unused code)768 public static String JOSM_pref(Environment env, String key, String def) { 769 769 return MapPaintStyles.getStyles().getPreferenceCached(env != null ? env.source : null, key, def); 770 770 } … … 778 778 * @since 5699 779 779 */ 780 public static boolean regexp_test(String pattern, String target) { // NO_UCD (unused code)780 public static boolean regexp_test(String pattern, String target) { 781 781 return Pattern.matches(pattern, target); 782 782 } … … 793 793 * @since 5699 794 794 */ 795 public static boolean regexp_test(String pattern, String target, String flags) { // NO_UCD (unused code)795 public static boolean regexp_test(String pattern, String target, String flags) { 796 796 int f = parse_regex_flags(flags); 797 797 return Pattern.compile(pattern, f).matcher(target).matches(); … … 811 811 * @since 5701 812 812 */ 813 public static List<String> regexp_match(String pattern, String target, String flags) { // NO_UCD (unused code)813 public static List<String> regexp_match(String pattern, String target, String flags) { 814 814 int f = parse_regex_flags(flags); 815 815 return Utils.getMatches(Pattern.compile(pattern, f).matcher(target)); … … 825 825 * @since 5701 826 826 */ 827 public static List<String> regexp_match(String pattern, String target) { // NO_UCD (unused code)827 public static List<String> regexp_match(String pattern, String target) { 828 828 return Utils.getMatches(Pattern.compile(pattern).matcher(target)); 829 829 } … … 835 835 * @see IPrimitive#getUniqueId() 836 836 */ 837 public static long osm_id(final Environment env) { // NO_UCD (unused code)837 public static long osm_id(final Environment env) { 838 838 return env.osm.getUniqueId(); 839 839 } … … 846 846 * @since 15246 847 847 */ 848 public static String osm_user_name(final Environment env) { // NO_UCD (unused code)848 public static String osm_user_name(final Environment env) { 849 849 return env.osm.getUser().getName(); 850 850 } … … 857 857 * @since 15246 858 858 */ 859 public static long osm_user_id(final Environment env) { // NO_UCD (unused code)859 public static long osm_user_id(final Environment env) { 860 860 return env.osm.getUser().getId(); 861 861 } … … 868 868 * @since 15246 869 869 */ 870 public static int osm_version(final Environment env) { // NO_UCD (unused code)870 public static int osm_version(final Environment env) { 871 871 return env.osm.getVersion(); 872 872 } … … 879 879 * @since 15246 880 880 */ 881 public static int osm_changeset_id(final Environment env) { // NO_UCD (unused code)881 public static int osm_changeset_id(final Environment env) { 882 882 return env.osm.getChangesetId(); 883 883 } … … 890 890 * @since 15246 891 891 */ 892 public static int osm_timestamp(final Environment env) { // NO_UCD (unused code)892 public static int osm_timestamp(final Environment env) { 893 893 return env.osm.getRawTimestamp(); 894 894 } … … 902 902 */ 903 903 @NullableArguments 904 public static String tr(Environment ignored, String... args) { // NO_UCD (unused code)904 public static String tr(Environment ignored, String... args) { 905 905 final String text = args[0]; 906 906 System.arraycopy(args, 1, args, 0, args.length - 1); … … 915 915 * @see String#substring(int) 916 916 */ 917 public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) { // NO_UCD (unused code)917 public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) { 918 918 return s == null ? null : s.substring((int) begin); 919 919 } … … 928 928 * @see String#substring(int, int) 929 929 */ 930 public static String substring(String s, float begin, float end) { // NO_UCD (unused code)930 public static String substring(String s, float begin, float end) { 931 931 return s == null ? null : s.substring((int) begin, (int) end); 932 932 } … … 940 940 * @see String#replace(CharSequence, CharSequence) 941 941 */ 942 public static String replace(String s, String target, String replacement) { // NO_UCD (unused code)942 public static String replace(String s, String target, String replacement) { 943 943 return s == null ? null : s.replace(target, replacement); 944 944 } … … 1055 1055 * @return the encoded string 1056 1056 */ 1057 public static String URL_encode(String s) { // NO_UCD (unused code)1057 public static String URL_encode(String s) { 1058 1058 return s == null ? null : Utils.encodeUrl(s); 1059 1059 } … … 1066 1066 * @return the encoded string 1067 1067 */ 1068 public static String XML_encode(String s) { // NO_UCD (unused code)1068 public static String XML_encode(String s) { 1069 1069 return s == null ? null : XmlWriter.encode(s); 1070 1070 } … … 1075 1075 * @return long value from 0 to 2^32-1 1076 1076 */ 1077 public static long CRC32_checksum(String s) { // NO_UCD (unused code)1077 public static long CRC32_checksum(String s) { 1078 1078 CRC32 cs = new CRC32(); 1079 1079 cs.update(s.getBytes(StandardCharsets.UTF_8)); … … 1129 1129 */ 1130 1130 @NullableArguments 1131 public static Object print(Object o) { // NO_UCD (unused code)1131 public static Object print(Object o) { 1132 1132 System.out.print(o == null ? "none" : o.toString()); 1133 1133 return o; … … 1141 1141 */ 1142 1142 @NullableArguments 1143 public static Object println(Object o) { // NO_UCD (unused code)1143 public static Object println(Object o) { 1144 1144 System.out.println(o == null ? "none" : o.toString()); 1145 1145 return o; … … 1151 1151 * @return number of tags 1152 1152 */ 1153 public static int number_of_tags(Environment env) { // NO_UCD (unused code)1153 public static int number_of_tags(Environment env) { 1154 1154 return env.osm.getNumKeys(); 1155 1155 } … … 1161 1161 * @return the value of the setting (calculated when the style is loaded) 1162 1162 */ 1163 public static Object setting(Environment env, String key) { // NO_UCD (unused code)1163 public static Object setting(Environment env, String key) { 1164 1164 return env.source.settingValues.get(key); 1165 1165 } … … 1171 1171 * @since 11247 1172 1172 */ 1173 public static LatLon center(Environment env) { // NO_UCD (unused code)1173 public static LatLon center(Environment env) { 1174 1174 return env.osm instanceof Node ? ((Node) env.osm).getCoor() : env.osm.getBBox().getCenter(); 1175 1175 } … … 1182 1182 * @since 11247 1183 1183 */ 1184 public static boolean inside(Environment env, String codes) { // NO_UCD (unused code)1184 public static boolean inside(Environment env, String codes) { 1185 1185 return Arrays.stream(codes.toUpperCase(Locale.ENGLISH).split(",", -1)) 1186 1186 .anyMatch(code -> Territories.isIso3166Code(code.trim(), center(env))); … … 1194 1194 * @since 11247 1195 1195 */ 1196 public static boolean outside(Environment env, String codes) { // NO_UCD (unused code)1196 public static boolean outside(Environment env, String codes) { 1197 1197 return !inside(env, codes); 1198 1198 } … … 1206 1206 * @since 12514 1207 1207 */ 1208 public static boolean at(Environment env, double lat, double lon) { // NO_UCD (unused code)1208 public static boolean at(Environment env, double lat, double lon) { 1209 1209 return new LatLon(lat, lon).equalsEpsilon(center(env)); 1210 1210 } … … 1217 1217 * @since 16110 1218 1218 */ 1219 public static boolean to_boolean(String value) { // NO_UCD (unused code)1219 public static boolean to_boolean(String value) { 1220 1220 return Boolean.parseBoolean(value); 1221 1221 } … … 1228 1228 * @since 16110 1229 1229 */ 1230 public static byte to_byte(String value) { // NO_UCD (unused code)1230 public static byte to_byte(String value) { 1231 1231 return Byte.parseByte(value); 1232 1232 } … … 1239 1239 * @since 16110 1240 1240 */ 1241 public static short to_short(String value) { // NO_UCD (unused code)1241 public static short to_short(String value) { 1242 1242 return Short.parseShort(value); 1243 1243 } … … 1250 1250 * @since 16110 1251 1251 */ 1252 public static int to_int(String value) { // NO_UCD (unused code)1252 public static int to_int(String value) { 1253 1253 return Integer.parseInt(value); 1254 1254 } … … 1261 1261 * @since 16110 1262 1262 */ 1263 public static long to_long(String value) { // NO_UCD (unused code)1263 public static long to_long(String value) { 1264 1264 return Long.parseLong(value); 1265 1265 } … … 1272 1272 * @since 16110 1273 1273 */ 1274 public static float to_float(String value) { // NO_UCD (unused code)1274 public static float to_float(String value) { 1275 1275 return Float.parseFloat(value); 1276 1276 } … … 1283 1283 * @since 16110 1284 1284 */ 1285 public static double to_double(String value) { // NO_UCD (unused code)1285 public static double to_double(String value) { 1286 1286 return Double.parseDouble(value); 1287 1287 }
Note:
See TracChangeset
for help on using the changeset viewer.