Changeset 11608 in josm for trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
- Timestamp:
- 2017-02-25T03:14:20+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r11587 r11608 706 706 * Replies true, if the map of key/value pairs of this primitive is not empty. 707 707 * 708 * @return true, if the map of key/value pairs of this primitive is not empty; false 709 * otherwise 708 * @return true, if the map of key/value pairs of this primitive is not empty; false otherwise 710 709 */ 711 710 @Override … … 718 717 * 719 718 * @param key the key 720 * @return true, if his primitive has a tag with key <code>key</code> 721 */ 719 * @return true, if this primitive has a tag with key <code>key</code> 720 */ 721 @Override 722 722 public boolean hasKey(String key) { 723 723 return key != null && indexOfKey(keys, key) >= 0; … … 728 728 * 729 729 * @param keys the keys 730 * @return true, if his primitive has a tag with any of the <code>keys</code>730 * @return true, if this primitive has a tag with any of the <code>keys</code> 731 731 * @since 11587 732 732 */ … … 758 758 759 759 /** 760 * Tests whether this primitive contains a tag consisting of {@code key} and {@code value s}.760 * Tests whether this primitive contains a tag consisting of {@code key} and {@code value}. 761 761 * @param key the key forming the tag. 762 762 * @param value value forming the tag. 763 * @return true if fprimitive contains a tag consisting of {@code key} and {@code value}.763 * @return true if primitive contains a tag consisting of {@code key} and {@code value}. 764 764 */ 765 765 public boolean hasTag(String key, String value) { … … 781 781 * @param key the key forming the tag. 782 782 * @param values one or many values forming the tag. 783 * @return true if fprimitive contains a tag consisting of {@code key} and any of {@code values}.783 * @return true if primitive contains a tag consisting of {@code key} and any of {@code values}. 784 784 */ 785 785 public boolean hasTag(String key, Collection<String> values) { 786 786 return values.contains(get(key)); 787 787 } 788 789 /** 790 * Tests whether this primitive contains a tag consisting of {@code key} and a value different from {@code value}. 791 * @param key the key forming the tag. 792 * @param value value not forming the tag. 793 * @return true if primitive contains a tag consisting of {@code key} and a value different from {@code value}. 794 * @since 11608 795 */ 796 public boolean hasTagDifferent(String key, String value) { 797 String v = get(key); 798 return v != null && !v.equals(value); 799 } 800 801 /** 802 * Tests whether this primitive contains a tag consisting of {@code key} and none of {@code values}. 803 * @param key the key forming the tag. 804 * @param values one or many values forming the tag. 805 * @return true if primitive contains a tag consisting of {@code key} and none of {@code values}. 806 * @since 11608 807 */ 808 public boolean hasTagDifferent(String key, String... values) { 809 return hasTagDifferent(key, Arrays.asList(values)); 810 } 811 812 /** 813 * Tests whether this primitive contains a tag consisting of {@code key} and none of {@code values}. 814 * @param key the key forming the tag. 815 * @param values one or many values forming the tag. 816 * @return true if primitive contains a tag consisting of {@code key} and none of {@code values}. 817 * @since 11608 818 */ 819 public boolean hasTagDifferent(String key, Collection<String> values) { 820 String v = get(key); 821 return v != null && !values.contains(v); 822 } 788 823 }
Note:
See TracChangeset
for help on using the changeset viewer.