public interface IPrimitive extends Tagged, PrimitiveId, Stylable, java.lang.Comparable<IPrimitive>
OsmPrimitive and PrimitiveData.MAX_TAG_LENGTH| Modifier and Type | Method and Description |
|---|---|
void |
accept(PrimitiveVisitor visitor)
Makes the given visitor visit this primitive.
|
int |
getChangesetId()
Replies the id of the changeset this primitive was last uploaded to.
|
java.lang.String |
getDisplayName(NameFormatter formatter)
Replies the display name of a primitive formatted by
formatter |
default OsmPrimitiveType |
getDisplayType()
Gets the type this primitive is displayed at
|
long |
getId()
Replies the id of this primitive.
|
java.lang.String |
getLocalName()
Replies a localized name for this primitive given by the value of the name tags
accessed from very specific (language variant) to more generic (default name).
|
java.lang.String |
getName()
Replies the name of this primitive.
|
PrimitiveId |
getPrimitiveId()
Replies the unique primitive id for this primitive
|
int |
getRawTimestamp()
Time of last modification to this object.
|
java.util.Date |
getTimestamp()
Time of last modification to this object.
|
User |
getUser()
Replies the user who has last touched this object.
|
int |
getVersion()
Replies the version number as returned by the API.
|
boolean |
hasDirectionKeys()
true if this object has direction dependent tags (e.g.
|
boolean |
isAnnotated()
Determines if this object is considered "annotated".
|
boolean |
isDeleted()
Replies
true, if the object has been deleted. |
default boolean |
isDisabled()
Replies true, if this primitive is disabled.
|
default boolean |
isDisabledAndHidden()
Replies true, if this primitive is disabled and marked as completely hidden on the map.
|
default boolean |
isDrawable()
Determines if this object is drawable.
|
boolean |
isHighlighted()
Checks if the highlight flag for this primitive was set
|
boolean |
isIncomplete()
Determines if this primitive is incomplete.
|
default boolean |
isMemberOfSelected()
Determines if this primitive is a member of a selected relation.
|
boolean |
isModified()
Replies
true if the object has been modified since it was loaded from
the server. |
default boolean |
isMultipolygon()
Determines if this object is a relation and behaves as a multipolygon.
|
boolean |
isNewOrUndeleted()
Determines if this primitive is new or undeleted.
|
default boolean |
isOuterMemberOfSelected()
Determines if this primitive is an outer member of a selected multipolygon relation.
|
default boolean |
isSelectable()
Determines if this object is selectable.
|
default boolean |
isSelected()
Determines whether the primitive is selected
|
boolean |
isTagged()
Determines if this object is considered "tagged".
|
boolean |
isTimestampEmpty()
Determines if this primitive has no timestamp information.
|
boolean |
isUndeleted()
Replies
true if the object has been deleted on the server and was undeleted by the user. |
boolean |
isUsable()
Replies
true, if the object is usable
(i.e. |
boolean |
isVisible()
Checks if object is known to the server.
|
boolean |
reversedDirection()
true if this object has the "reversed direction" flag enabled
|
void |
setChangesetId(int changesetId)
Sets the changeset id of this primitive.
|
void |
setDeleted(boolean deleted)
Sets whether this primitive is deleted or not.
|
void |
setHighlighted(boolean highlighted)
Updates the highlight flag for this primitive.
|
void |
setModified(boolean modified)
Marks this primitive as being modified.
|
void |
setOsmId(long id,
int version)
Sets the id and the version of this primitive if it is known to the OSM API.
|
void |
setRawTimestamp(int timestamp)
Sets time of last modification to this object
|
void |
setTimestamp(java.util.Date timestamp)
Sets time of last modification to this object
|
void |
setUser(User user)
Sets the user who has last touched this object.
|
void |
setVisible(boolean visible)
Sets whether this primitive is visible, i.e.
|
get, getKeys, getNumKeys, hasKey, hasKeys, hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, keySet, put, put, remove, removeAll, setKeys, visitKeysgetType, getUniqueId, isNewclearCachedStyle, declareCachedStyleUpToDate, getCachedStyle, isCachedStyleUpToDate, setCachedStyleboolean isModified()
true if the object has been modified since it was loaded from
the server. In this case, on next upload, this object will be updated.
Deleted objects are deleted from the server. If the objects are added (id=0),
the modified is ignored and the object is added to the server.true if the object has been modified since it was loaded from
the servervoid setModified(boolean modified)
modified - true, if this primitive is to be modifiedboolean isVisible()
true, if the object is visible on server.setVisible(boolean)void setVisible(boolean visible)
visible - true if this primitive is visiblejava.lang.IllegalStateException - if visible is set to false on an primitive with id==0isVisible()boolean isDeleted()
true, if the object has been deleted.true, if the object has been deleted.setDeleted(boolean)void setDeleted(boolean deleted)
deleted - true, if this primitive is deleted; false, otherwiseboolean isIncomplete()
true if this primitive is incomplete, false otherwiseboolean isUndeleted()
true if the object has been deleted on the server and was undeleted by the user.true if the object has been undeletedboolean isUsable()
true, if the object is usable
(i.e. complete and not deleted).true, if the object is usable.setDeleted(boolean)boolean isNewOrUndeleted()
PrimitiveId.isNew(),
isUndeleted()default boolean isDisabled()
true if this object has the "disabled" flag enableddefault boolean isDisabledAndHidden()
true if this object has both the "disabled" and "hide if disabled" flags enableddefault boolean isSelectable()
A primitive can be selected if all conditions are met:
true if this object is selectabledefault boolean isDrawable()
A primitive is complete if all conditions are met:
true if this object is drawabledefault boolean isSelected()
default boolean isMemberOfSelected()
true if this primitive is a member of a selected relation, false otherwisedefault boolean isOuterMemberOfSelected()
true if this primitive is an outer member of a selected multipolygon relation, false otherwiselong getId()
PrimitiveId getPrimitiveId()
int getVersion()
PrimitiveData.setVersion(int)void setOsmId(long id, int version)
id - the id. > 0 requiredversion - the version > 0 requiredjava.lang.IllegalArgumentException - if id <= 0java.lang.IllegalArgumentException - if version <= 0DataIntegrityProblemException - if id is changed and primitive was already added to the datasetUser getUser()
void setUser(User user)
user - the userjava.util.Date getTimestamp()
setTimestamp(java.util.Date)int getRawTimestamp()
setRawTimestamp(int)void setTimestamp(java.util.Date timestamp)
timestamp - date of last modificationgetTimestamp()void setRawTimestamp(int timestamp)
timestamp - date of last modificationgetRawTimestamp()boolean isTimestampEmpty()
true if this primitive has no timestamp informationgetTimestamp(),
getRawTimestamp()int getChangesetId()
void setChangesetId(int changesetId)
changesetId - the id. >= 0 required.java.lang.IllegalStateException - if this primitive is new.java.lang.IllegalArgumentException - if id < 0void accept(PrimitiveVisitor visitor)
visitor - visitorjava.lang.String getName()
name or null, if this tag is not present.java.lang.String getLocalName()
null if no name existsLanguageInfo.getLanguageCodes(java.util.Locale)java.lang.String getDisplayName(NameFormatter formatter)
formatterformatter - formatter to usedefault OsmPrimitiveType getDisplayType()
OsmPrimitiveTypevoid setHighlighted(boolean highlighted)
highlighted - The new highlight flag.boolean isHighlighted()
boolean isTagged()
boolean isAnnotated()
default boolean isMultipolygon()
true if it is a real multipolygon or a boundary relationboolean hasDirectionKeys()
true if this object has direction dependent tagsboolean reversedDirection()
true if this object has the "reversed direction" flag enabled