Package org.openstreetmap.josm.data.osm
Class RelationData
- java.lang.Object
-
- org.openstreetmap.josm.data.osm.AbstractPrimitive
-
- org.openstreetmap.josm.data.osm.PrimitiveData
-
- org.openstreetmap.josm.data.osm.RelationData
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<IPrimitive>
,IQuadBucketType
,IFilterablePrimitive
,IPrimitive
,IRelation<RelationMemberData>
,PrimitiveId
,Stylable
,Tagged
public class RelationData extends PrimitiveData implements IRelation<RelationMemberData>
Relation data.- Since:
- 2284
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static UniqueIdGenerator
idGenerator
private java.util.List<RelationMemberData>
members
private static long
serialVersionUID
-
Fields inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive
changesetId, FLAG_ALL_REFERRERS_DOWNLOADED, FLAG_ANNOTATED, FLAG_DELETED, FLAG_DIRECTION_REVERSED, FLAG_DISABLED, FLAG_DISABLED_TYPE, FLAG_HAS_DIRECTIONS, FLAG_HIDDEN_TYPE, FLAG_HIDE_IF_DISABLED, FLAG_HIGHLIGHTED, FLAG_INCOMPLETE, FLAG_MODIFIED, FLAG_PRESERVED, FLAG_TAGGED, FLAG_VISIBLE, flags, id, keys, mappaintCacheIdx, timestamp, user, version
-
Fields inherited from interface org.openstreetmap.josm.data.osm.Tagged
MAX_TAG_LENGTH
-
-
Constructor Summary
Constructors Constructor Description RelationData()
Constructs a newRelationData
.RelationData(long id)
Constructs a newRelationData
with given id.RelationData(RelationData data)
Constructs a newRelationData
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(PrimitiveVisitor visitor)
Makes the given visitor visit this primitive.BBox
getBBox()
Fetches the bounding box of the primitive.UniqueIdGenerator
getIdGenerator()
Returns the unique identifier generator.RelationMemberData
getMember(int index)
Returns the relation member at the specified index.long
getMemberId(int idx)
Returns id of the member at given index.java.util.List<RelationMemberData>
getMembers()
Returns members of the relation.int
getMembersCount()
Returns the number of members.OsmPrimitiveType
getMemberType(int idx)
Returns type of the member at given index.java.lang.String
getRole(int idx)
Returns role of the member at given index.OsmPrimitiveType
getType()
Gets the type of object represented by this object.RelationData
makeCopy()
Returns a copy of this primitive data.void
setMembers(java.util.List<RelationMemberData> memberData)
Sets members of the relation.java.lang.String
toString()
-
Methods inherited from class org.openstreetmap.josm.data.osm.PrimitiveData
declareCachedStyleUpToDate, getCachedStyle, getDataSet, getReferrers, hasDirectionKeys, isAnnotated, isCachedStyleUpToDate, isHighlighted, isTagged, keysChangedImpl, reversedDirection, setCachedStyle, setHighlighted, setId, setIncomplete, setVersion, visitReferrers
-
Methods inherited from class org.openstreetmap.josm.data.osm.AbstractPrimitive
clearOsmMetadata, cloneFrom, doGet, get, getChangesetId, getDisabledType, getDiscardableKeys, getFlagsAsString, getHiddenType, getId, getIgnoreCase, getInstant, getInterestingTags, getKeys, getNumKeys, getRawTimestamp, getTimestamp, getUninterestingKeys, getUniqueId, getUser, getVersion, getWorkInProgressKeys, hasKey, hasKey, hasKeys, isDeleted, isDisabled, isDisabledAndHidden, isDrawable, isIncomplete, isModified, isNew, isNewOrUndeleted, isPreserved, isReferrersDownloaded, isTimestampEmpty, isUndeleted, isUninterestingKey, isUsable, isVisible, keys, keySet, put, putAll, remove, removeAll, setChangesetId, setDeleted, setDisabledState, setDisabledType, setHiddenType, setInstant, setKeys, setKeys, setModified, setOsmId, setRawTimestamp, setReferrersDownloaded, setTimestamp, setUser, setVisible, unsetDisabledState, updateFlags, updateFlagsChanged, visitKeys
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.osm.IPrimitive
getChangesetId, getDataSet, getDisplayType, getId, getInstant, getInterestingTags, getLocalName, getName, getOsmId, getOsmPrimitiveId, getPrimitiveId, getRawTimestamp, getReferrers, getReferrers, getStyleCacheSyncObject, getTimestamp, getUser, getVersion, hasDirectionKeys, hasSameInterestingTags, isAnnotated, isDeleted, isDisabled, isDisabledAndHidden, isDrawable, isHighlighted, isIncomplete, isMemberOfSelected, isModified, isNewOrUndeleted, isOuterMemberOfSelected, isPreserved, isReferrersDownloaded, isSelectable, isSelected, isTagged, isTimestampEmpty, isUndeleted, isUsable, isVisible, reversedDirection, setChangesetId, setDeleted, setHighlighted, setInstant, setModified, setOsmId, setRawTimestamp, setReferrersDownloaded, setTimestamp, setUser, setVisible, visitReferrers
-
Methods inherited from interface org.openstreetmap.josm.data.osm.IRelation
compareTo, findRelationMembers, getChildren, getDisplayName, getIncompleteMembers, getMemberPrimitivesList, hasIncompleteMembers, isBoundary, isEmpty, isMultipolygon, isUseful
-
Methods inherited from interface org.openstreetmap.josm.data.osm.PrimitiveId
getUniqueId, isNew
-
Methods inherited from interface org.openstreetmap.josm.data.osm.Stylable
clearCachedStyle, declareCachedStyleUpToDate, getCachedStyle, isCachedStyleUpToDate, setCachedStyle
-
Methods inherited from interface org.openstreetmap.josm.data.osm.Tagged
get, getKeys, getNumKeys, hasKey, hasKeys, hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, isKeyFalse, isKeyTrue, keys, keySet, put, put, putAll, remove, removeAll, setKeys, visitKeys
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
idGenerator
private static final UniqueIdGenerator idGenerator
-
members
private java.util.List<RelationMemberData> members
-
-
Constructor Detail
-
RelationData
public RelationData()
Constructs a newRelationData
.
-
RelationData
public RelationData(long id)
Constructs a newRelationData
with given id.- Parameters:
id
- id- Since:
- 12017
-
RelationData
public RelationData(RelationData data)
Constructs a newRelationData
.- Parameters:
data
- relation data to copy
-
-
Method Detail
-
getMembers
public java.util.List<RelationMemberData> getMembers()
Description copied from interface:IRelation
Returns members of the relation.- Specified by:
getMembers
in interfaceIRelation<RelationMemberData>
- Returns:
- Members of the relation. Changes made in returned list are not mapped
back to the primitive, use
IRelation.setMembers(java.util.List<M>)
to modify the members
-
setMembers
public void setMembers(java.util.List<RelationMemberData> memberData)
Description copied from interface:IRelation
Sets members of the relation.- Specified by:
setMembers
in interfaceIRelation<RelationMemberData>
- Parameters:
memberData
- Can be null, in that case all members are removed
-
getMembersCount
public int getMembersCount()
Description copied from interface:IRelation
Returns the number of members.- Specified by:
getMembersCount
in interfaceIRelation<RelationMemberData>
- Returns:
- number of members
-
getMember
public RelationMemberData getMember(int index)
Description copied from interface:IRelation
Returns the relation member at the specified index.- Specified by:
getMember
in interfaceIRelation<RelationMemberData>
- Parameters:
index
- the index of the relation member- Returns:
- relation member at the specified index
-
getMemberId
public long getMemberId(int idx)
Description copied from interface:IRelation
Returns id of the member at given index.- Specified by:
getMemberId
in interfaceIRelation<RelationMemberData>
- Parameters:
idx
- member index- Returns:
- id of the member at given index
-
getRole
public java.lang.String getRole(int idx)
Description copied from interface:IRelation
Returns role of the member at given index.- Specified by:
getRole
in interfaceIRelation<RelationMemberData>
- Parameters:
idx
- member index- Returns:
- role of the member at given index
-
getMemberType
public OsmPrimitiveType getMemberType(int idx)
Description copied from interface:IRelation
Returns type of the member at given index.- Specified by:
getMemberType
in interfaceIRelation<RelationMemberData>
- Parameters:
idx
- member index- Returns:
- type of the member at given index
-
makeCopy
public RelationData makeCopy()
Description copied from class:PrimitiveData
Returns a copy of this primitive data.- Specified by:
makeCopy
in classPrimitiveData
- Returns:
- a copy of this primitive data
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPrimitiveData
-
getType
public OsmPrimitiveType getType()
Description copied from interface:PrimitiveId
Gets the type of object represented by this object. Note that this should return the base primitive type (OsmPrimitiveType.NODE
,OsmPrimitiveType.WAY
, andOsmPrimitiveType.RELATION
).- Specified by:
getType
in interfacePrimitiveId
- Returns:
- the object type
- See Also:
Node
,Way
,Relation
-
accept
public void accept(PrimitiveVisitor visitor)
Description copied from interface:IPrimitive
Makes the given visitor visit this primitive.- Specified by:
accept
in interfaceIPrimitive
- Parameters:
visitor
- visitor
-
getBBox
public BBox getBBox()
Description copied from interface:IPrimitive
Fetches the bounding box of the primitive. Since 17752, the returned bounding box might be immutable, i.e., modifying calls throw anUnsupportedOperationException
.- Specified by:
getBBox
in interfaceIPrimitive
- Specified by:
getBBox
in interfaceIQuadBucketType
- Returns:
- Bounding box of the object
-
getIdGenerator
public UniqueIdGenerator getIdGenerator()
Description copied from class:AbstractPrimitive
Returns the unique identifier generator.- Specified by:
getIdGenerator
in classAbstractPrimitive
- Returns:
- the unique identifier generator
-
-