source: josm/trunk/src/org/openstreetmap/josm/data/osm/Tagged.java@ 11190

Last change on this file since 11190 was 10736, checked in by Don-vip, 8 years ago

fix #13271 - Make TagCollection count the occurence of tags (patch by michael2402) - gsoc-core

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm;
3
4import java.util.Collection;
5import java.util.Map;
6/**
7 * Objects implement Tagged if they provide a map of key/value pairs.
8 *
9 *
10 */
11// FIXME: better naming? setTags(), getTags(), getKeys() instead of keySet() ?
12//
13public interface Tagged {
14 /**
15 * Sets the map of key/value pairs
16 *
17 * @param keys the map of key value pairs. If null, reset to the empty map.
18 */
19 void setKeys(Map<String, String> keys);
20
21 /**
22 * Replies the map of key/value pairs. Never null, but may be the empty map.
23 *
24 * @return the map of key/value pairs
25 */
26 Map<String, String> getKeys();
27
28 /**
29 * Sets a key/value pairs
30 *
31 * @param key the key
32 * @param value the value. If null, removes the key/value pair.
33 */
34 void put(String key, String value);
35
36 /**
37 * Sets a key/value pairs
38 *
39 * @param tag The tag to set.
40 * @since 10736
41 */
42 default void put(Tag tag) {
43 put(tag.getKey(), tag.getValue());
44 }
45
46 /**
47 * Replies the value of the given key; null, if there is no value for this key
48 *
49 * @param key the key
50 * @return the value
51 */
52 String get(String key);
53
54 /**
55 * Removes a given key/value pair
56 *
57 * @param key the key
58 */
59 void remove(String key);
60
61 /**
62 * Replies true, if there is at least one key/value pair; false, otherwise
63 *
64 * @return true, if there is at least one key/value pair; false, otherwise
65 */
66 boolean hasKeys();
67
68 /**
69 * Replies the set of keys
70 *
71 * @return the set of keys
72 */
73 Collection<String> keySet();
74
75 /**
76 * Removes all tags
77 */
78 void removeAll();
79}
Note: See TracBrowser for help on using the repository browser.