public interface IPrimitive extends Tagged, PrimitiveId
OsmPrimitive
and PrimitiveData
.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.
|
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 |
isDeleted()
Replies
true , if the object has been deleted. |
boolean |
isIncomplete()
Determines if this primitive is incomplete.
|
boolean |
isModified()
Replies
true if the object has been modified since it was loaded from
the server. |
boolean |
isNewOrUndeleted()
Determines if this primitive is new or undeleted.
|
boolean |
isTimestampEmpty()
Determines if this primitive has no timestam 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.
|
void |
setChangesetId(int changesetId)
Sets the changeset id of this primitive.
|
void |
setDeleted(boolean deleted)
Sets whether this primitive is deleted or not.
|
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, hasKeys, keySet, put, put, remove, removeAll, setKeys
getType, getUniqueId, isNew
boolean 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()
long 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 timestam 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()
java.lang.String getLocalName()
null
if no name existsLanguageInfo.getLanguageCodes(java.util.Locale)