source: josm/trunk/src/org/openstreetmap/josm/data/osm/history/RelationMember.java@ 2512

Last change on this file since 2512 was 2512, checked in by stoecker, 14 years ago

i18n updated, fixed files to reduce problems when applying patches, fix #4017

File size: 1.8 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.osm.history;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
7
8/**
9 * Represents a relation member in the the context of a historical view on
10 * OSM data.
11 *
12 */
13public class RelationMember {
14
15 private String role;
16 private OsmPrimitiveType primitiveType;
17 private long primitiveId;
18
19 /**
20 *
21 * @param role the role
22 * @param primitiveType the type (must not be null)
23 * @param primitiveId the id (>0 required)
24 *
25 * @exception IllegalArgumentException thrown, if primitiveType is null
26 * @exception IllegalArgumentException thrown, if primitiveId <= 0
27 */
28 public RelationMember(String role, OsmPrimitiveType primitiveType, long primitiveId) {
29 this.role = (role == null ? "" : role);
30 if (primitiveType == null)
31 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitiveType"));
32 this.primitiveType = primitiveType;
33 if (primitiveId <=0)
34 throw new IllegalArgumentException(tr("Parameter ''{0}'' > 0 expected. Got ''{1}''.", "primitiveId", primitiveId));
35 this.primitiveId = primitiveId;
36 }
37
38 /**
39 * replies the member role
40 * @return the member role
41 */
42 public String getRole() {
43 return role;
44 }
45
46 /**
47 * replies the type of the referenced OSM primitive
48 *
49 * @return the type of the referenced OSM primitive
50 */
51 public OsmPrimitiveType getPrimitiveType() {
52 return primitiveType;
53 }
54
55 /**
56 * replies the id of the referenced OSM primitive
57 *
58 * @return the id of the referenced OSM primitive
59 */
60 public long getPrimitiveId() {
61 return primitiveId;
62 }
63}
Note: See TracBrowser for help on using the repository browser.