Changeset 6823 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2014-02-07T01:34:02+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r6317 r6823 16 16 import java.util.Map.Entry; 17 17 import java.util.Set; 18 import java.util.regex.Pattern; 19 18 20 import org.openstreetmap.josm.tools.Utils; 19 21 20 22 /** 21 23 * TagCollection is a collection of tags which can be used to manipulate 22 * tags managed by {@link OsmPrimitive}s.24 * tags managed by {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s. 23 25 * 24 26 * A TagCollection can be created: 25 27 * <ul> 26 * <li>from the tags managed by a specific {@link OsmPrimitive} with {@link #from(Tagged)}</li>27 * <li>from the union of all tags managed by a collection of {@link OsmPrimitive}s with {@link #unionOfAllPrimitives(Collection)}</li>28 * <li>from the union of all tags managed by a {@link DataSet} with {@link #unionOfAllPrimitives(DataSet)}</li>29 * <li>from the intersection of all tags managed by a collection of primitives with {@link #commonToAllPrimitives( Collection)}</li>28 * <li>from the tags managed by a specific {@link org.openstreetmap.josm.data.osm.OsmPrimitive} with {@link #from(org.openstreetmap.josm.data.osm.Tagged)}</li> 29 * <li>from the union of all tags managed by a collection of {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s with {@link #unionOfAllPrimitives(java.util.Collection)}</li> 30 * <li>from the union of all tags managed by a {@link org.openstreetmap.josm.data.osm.DataSet} with {@link #unionOfAllPrimitives(org.openstreetmap.josm.data.osm.DataSet)}</li> 31 * <li>from the intersection of all tags managed by a collection of primitives with {@link #commonToAllPrimitives(java.util.Collection)}</li> 30 32 * </ul> 31 33 * … … 33 35 * 34 36 * Basic set operations allow to create the union, the intersection and the difference 35 * of tag collections, see {@link #union( TagCollection)}, {@link #intersect(TagCollection)},36 * and {@link #minus( TagCollection)}.37 * of tag collections, see {@link #union(org.openstreetmap.josm.data.osm.TagCollection)}, {@link #intersect(org.openstreetmap.josm.data.osm.TagCollection)}, 38 * and {@link #minus(org.openstreetmap.josm.data.osm.TagCollection)}. 37 39 * 38 40 * … … 42 44 /** 43 45 * Creates a tag collection from the tags managed by a specific 44 * {@link OsmPrimitive}. If <code>primitive</code> is null, replies46 * {@link org.openstreetmap.josm.data.osm.OsmPrimitive}. If <code>primitive</code> is null, replies 45 47 * an empty tag collection. 46 48 * 47 49 * @param primitive the primitive 48 50 * @return a tag collection with the tags managed by a specific 49 * {@link OsmPrimitive}51 * {@link org.openstreetmap.josm.data.osm.OsmPrimitive} 50 52 */ 51 53 public static TagCollection from(Tagged primitive) { … … 590 592 591 593 /** 592 * Applies this tag collection to an {@link OsmPrimitive}. Does nothing if594 * Applies this tag collection to an {@link org.openstreetmap.josm.data.osm.OsmPrimitive}. Does nothing if 593 595 * primitive is null 594 596 * … … 611 613 612 614 /** 613 * Applies this tag collection to a collection of {@link OsmPrimitive}s. Does nothing if615 * Applies this tag collection to a collection of {@link org.openstreetmap.josm.data.osm.OsmPrimitive}s. Does nothing if 614 616 * primitives is null 615 617 * … … 628 630 629 631 /** 630 * Replaces the tags of an {@link OsmPrimitive} by the tags in this collection . Does nothing if632 * Replaces the tags of an {@link org.openstreetmap.josm.data.osm.OsmPrimitive} by the tags in this collection . Does nothing if 631 633 * primitive is null 632 634 * … … 646 648 647 649 /** 648 * Replaces the tags of a collection of{@link OsmPrimitive}s by the tags in this collection.650 * Replaces the tags of a collection of{@link org.openstreetmap.josm.data.osm.OsmPrimitive}s by the tags in this collection. 649 651 * Does nothing if primitives is null 650 652 * … … 716 718 } 717 719 720 private static final Pattern SPLIT_VALUES_PATTERN = Pattern.compile(";\\s*"); 721 718 722 /** 719 723 * Replies the concatenation of all tag values (concatenated by a semicolon) … … 732 736 Map<String, Collection<String>> originalSplitValues = new LinkedHashMap<String, Collection<String>>(); 733 737 for (String v : originalValues) { 734 List<String> vs = Arrays.asList( v.split(";\\s*"));738 List<String> vs = Arrays.asList(SPLIT_VALUES_PATTERN.split(v)); 735 739 originalSplitValues.put(v, vs); 736 740 values.addAll(vs);
Note:
See TracChangeset
for help on using the changeset viewer.