public class HistoryRelation extends HistoryOsmPrimitive
Modifier and Type | Field and Description |
---|---|
private List<RelationMemberData> |
members |
Constructor and Description |
---|
HistoryRelation(long id,
long version,
boolean visible,
User user,
long changesetId,
Date timestamp)
constructor
|
HistoryRelation(long id,
long version,
boolean visible,
User user,
long changesetId,
Date timestamp,
boolean checkHistoricParams)
constructor
|
HistoryRelation(long id,
long version,
boolean visible,
User user,
long changesetId,
Date timestamp,
List<RelationMemberData> members)
constructor
|
HistoryRelation(Relation r)
Constructs a new
HistoryRelation from an existing Relation . |
Modifier and Type | Method and Description |
---|---|
void |
addMember(RelationMemberData member)
adds a member to the list of members
|
String |
getDisplayName(HistoryNameFormatter formatter)
Replies the display name of a primitive formatted by
formatter |
List<RelationMemberData> |
getMembers()
replies an immutable list of members of this relation
|
int |
getNumMembers()
replies the number of members
|
RelationMemberData |
getRelationMember(int idx)
replies the idx-th member
|
OsmPrimitiveType |
getType()
replies the type, i.e.
|
compareTo, ensurePositiveLong, equals, forOsmPrimitive, get, getChangeset, getChangesetId, getId, getLocalName, getName, getPrimitiveId, getTags, getTimestamp, getUser, getVersion, hashCode, hasTag, isVisible, matches, matches, put, setChangeset, setTags, toString
private List<RelationMemberData> members
public HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Date timestamp) throws IllegalArgumentException
id
- the id (> 0 required)version
- the version (> 0 required)visible
- whether the primitive is still visibleuser
- the user (!= null required)changesetId
- the changeset id (> 0 required)timestamp
- the timestamp (!= null required)IllegalArgumentException
- if preconditions are violatedpublic HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Date timestamp, boolean checkHistoricParams) throws IllegalArgumentException
id
- the id (> 0 required)version
- the version (> 0 required)visible
- whether the primitive is still visibleuser
- the user (!= null required)changesetId
- the changeset id (> 0 required if checkHistoricParams
is true)timestamp
- the timestamp (!= null required if checkHistoricParams
is true)checkHistoricParams
- If true, checks values of changesetId
and timestamp
IllegalArgumentException
- if preconditions are violatedpublic HistoryRelation(long id, long version, boolean visible, User user, long changesetId, Date timestamp, List<RelationMemberData> members)
id
- the id (> 0 required)version
- the version (> 0 required)visible
- whether the primitive is still visibleuser
- the user (!= null required)changesetId
- the changeset id (> 0 required)timestamp
- the timestamp (!= null required)members
- list of members for this relationIllegalArgumentException
- thrown if preconditions are violatedpublic HistoryRelation(Relation r)
HistoryRelation
from an existing Relation
.r
- the relationpublic List<RelationMemberData> getMembers()
public int getNumMembers()
public RelationMemberData getRelationMember(int idx) throws IndexOutOfBoundsException
idx
- the indexIndexOutOfBoundsException
- thrown, if idx is out of boundspublic OsmPrimitiveType getType()
OsmPrimitiveType.RELATION
getType
in class HistoryOsmPrimitive
public void addMember(RelationMemberData member) throws IllegalArgumentException
member
- the member (must not be null)IllegalArgumentException
- thrown, if member is nullpublic String getDisplayName(HistoryNameFormatter formatter)
HistoryOsmPrimitive
formatter
getDisplayName
in class HistoryOsmPrimitive
formatter
- The formatter used to generate a display name