Last change
on this file since 6 was 6, checked in by imi, 19 years ago |
- pretty preferrences menu
- drawing double circles on double position hit
- mergeNodes option
|
File size:
1.0 KB
|
Line | |
---|
1 | package org.openstreetmap.josm.data.osm;
|
---|
2 |
|
---|
3 | import java.util.Map;
|
---|
4 |
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * An OSM primitive can be associated with a key/value pair. It can be created, deleted
|
---|
8 | * and updated within the OSM-Server.
|
---|
9 | *
|
---|
10 | * @author imi
|
---|
11 | */
|
---|
12 | public class OsmPrimitive {
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * The key/value list for this primitive.
|
---|
16 | */
|
---|
17 | public Map<Key, String> keys;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * If set to true, this object has been modified in the current session.
|
---|
21 | */
|
---|
22 | transient public boolean modified = false;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * If set to true, this object is currently selected.
|
---|
26 | */
|
---|
27 | transient public boolean selected = false;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Osm primitives are equal, when their keys are equal.
|
---|
31 | */
|
---|
32 | @Override
|
---|
33 | public boolean equals(Object obj) {
|
---|
34 | if (obj == null)
|
---|
35 | return false;
|
---|
36 | if (!(obj instanceof OsmPrimitive))
|
---|
37 | return false;
|
---|
38 | OsmPrimitive osm = (OsmPrimitive)obj;
|
---|
39 | if (keys == null)
|
---|
40 | return osm.keys == null;
|
---|
41 | return keys.equals(osm.keys);
|
---|
42 | }
|
---|
43 |
|
---|
44 | /**
|
---|
45 | * Compute the hashCode from the keys.
|
---|
46 | */
|
---|
47 | @Override
|
---|
48 | public int hashCode() {
|
---|
49 | return keys == null ? 0 : keys.hashCode();
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.