public abstract class PrimitiveData extends AbstractPrimitive implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
changesetId, 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, timestamp, user, version
MAX_TAG_LENGTH
Constructor and Description |
---|
PrimitiveData()
Constructs a new
PrimitiveData . |
PrimitiveData(long id)
Constructs a new
PrimitiveData with given id. |
PrimitiveData(PrimitiveData data)
Constructs a new
PrimitiveData from an existing one. |
Modifier and Type | Method and Description |
---|---|
void |
declareCachedStyleUpToDate()
Declare that the cached style for this primitive is up to date.
|
StyleCache |
getCachedStyle()
Returns the cached style.
|
OsmData<?,?,?,?> |
getDataSet()
Returns the parent data set of this primitive.
|
static <T extends PrimitiveData> |
getFilteredList(java.util.Collection<T> list,
OsmPrimitiveType type)
Returns a filtered list for a given primitive type.
|
java.util.List<PrimitiveData> |
getReferrers(boolean allowWithoutDataset)
Find primitives that reference this primitive.
|
boolean |
hasDirectionKeys()
true if this object has direction dependent tags (e.g.
|
boolean |
isAnnotated()
Determines if this object is considered "annotated".
|
boolean |
isCachedStyleUpToDate()
Check if the cached style for this primitive is up to date.
|
boolean |
isHighlighted()
Checks if the highlight flag for this primitive was set
|
boolean |
isTagged()
Determines if this object is considered "tagged".
|
protected void |
keysChangedImpl(java.util.Map<java.lang.String,java.lang.String> originalKeys)
What to do, when the tags have changed by one of the tag-changing methods.
|
abstract PrimitiveData |
makeCopy()
Returns a copy of this primitive data.
|
private void |
readObject(java.io.ObjectInputStream ois) |
boolean |
reversedDirection()
true if this object has the "reversed direction" flag enabled
|
void |
setCachedStyle(StyleCache mappaintStyle)
Sets the cached style.
|
void |
setHighlighted(boolean highlighted)
Updates the highlight flag for this primitive.
|
void |
setId(long id)
Sets the primitive identifier.
|
void |
setIncomplete(boolean incomplete)
override to make it public
|
void |
setVersion(int version)
Sets the primitive version.
|
java.lang.String |
toString() |
void |
visitReferrers(PrimitiveVisitor visitor)
Visits
visitor for all referrers. |
private void |
writeObject(java.io.ObjectOutputStream oos) |
advanceUniqueId, clearOsmMetadata, cloneFrom, currentUniqueId, generateUniqueId, get, getChangesetId, getDiscardableKeys, getFlagsAsString, getId, getIgnoreCase, getInterestingTags, getKeys, getNumKeys, getRawTimestamp, getTimestamp, getUninterestingKeys, getUniqueId, getUser, getVersion, getWorkInProgressKeys, hasKey, hasKey, hasKeys, isDeleted, isIncomplete, isModified, isNew, isNewOrUndeleted, isTimestampEmpty, isUndeleted, isUninterestingKey, isUsable, isVisible, keySet, put, remove, removeAll, setChangesetId, setDeleted, setKeys, setKeys, setModified, setOsmId, setRawTimestamp, setTimestamp, setUser, setVisible, updateFlags, visitKeys
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, getBBox, getDisplayName, getDisplayType, getLocalName, getName, getOsmId, getOsmPrimitiveId, getPrimitiveId, getReferrers, hasSameInterestingTags, isDisabled, isDisabledAndHidden, isDrawable, isMemberOfSelected, isMultipolygon, isOuterMemberOfSelected, isPreserved, isSelectable, isSelected
hasTag, hasTag, hasTag, hasTag, hasTagDifferent, hasTagDifferent, hasTagDifferent, isKeyFalse, isKeyTrue, put
getType
clearCachedStyle
private static final long serialVersionUID
public PrimitiveData()
PrimitiveData
.public PrimitiveData(long id)
PrimitiveData
with given id.id
- idpublic PrimitiveData(PrimitiveData data)
PrimitiveData
from an existing one.data
- the data to copypublic void setId(long id)
id
- primitive identifierpublic void setVersion(int version)
version
- primitive versionpublic void setIncomplete(boolean incomplete)
setIncomplete
in class AbstractPrimitive
incomplete
- incomplete flag valuepublic abstract PrimitiveData makeCopy()
public java.lang.String toString()
toString
in class java.lang.Object
public static <T extends PrimitiveData> java.util.List<T> getFilteredList(java.util.Collection<T> list, OsmPrimitiveType type)
T
- primitive typelist
- list to filtertype
- primitive typeprotected final void keysChangedImpl(java.util.Map<java.lang.String,java.lang.String> originalKeys)
AbstractPrimitive
keysChangedImpl
in class AbstractPrimitive
originalKeys
- original tagsprivate void writeObject(java.io.ObjectOutputStream oos) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException
java.lang.ClassNotFoundException
java.io.IOException
public boolean isTagged()
IPrimitive
isTagged
in interface IPrimitive
public boolean isAnnotated()
IPrimitive
isAnnotated
in interface IPrimitive
public boolean hasDirectionKeys()
IPrimitive
hasDirectionKeys
in interface IPrimitive
true
if this object has direction dependent tagspublic boolean reversedDirection()
IPrimitive
reversedDirection
in interface IPrimitive
true
if this object has the "reversed direction" flag enabledpublic void setHighlighted(boolean highlighted)
IPrimitive
setHighlighted
in interface IPrimitive
highlighted
- The new highlight flag.public boolean isHighlighted()
IPrimitive
isHighlighted
in interface IPrimitive
public final java.util.List<PrimitiveData> getReferrers(boolean allowWithoutDataset)
IPrimitive
Way wnew = new Way(existingWay)
getReferrers
in interface IPrimitive
allowWithoutDataset
- If true, method will return empty list if primitive is not part of the dataset. If false,
exception will be thrown in this casepublic void visitReferrers(PrimitiveVisitor visitor)
IPrimitive
Visits visitor
for all referrers.
visitReferrers
in interface IPrimitive
visitor
- the visitor. Ignored, if null.public OsmData<?,?,?,?> getDataSet()
IPrimitive
getDataSet
in interface IPrimitive
public StyleCache getCachedStyle()
Stylable
getCachedStyle
in interface Stylable
public void setCachedStyle(StyleCache mappaintStyle)
Stylable
setCachedStyle
in interface Stylable
mappaintStyle
- the cached stylepublic boolean isCachedStyleUpToDate()
Stylable
isCachedStyleUpToDate
in interface Stylable
public void declareCachedStyleUpToDate()
Stylable
declareCachedStyleUpToDate
in interface Stylable