Class PrimitiveData

    • Constructor Detail

      • PrimitiveData

        protected PrimitiveData​(long id)
        Constructs a new PrimitiveData with given id.
        Parameters:
        id - id
        Since:
        12017
      • PrimitiveData

        protected PrimitiveData​(PrimitiveData data)
        Constructs a new PrimitiveData from an existing one.
        Parameters:
        data - the data to copy
    • Method Detail

      • setId

        public void setId​(long id)
        Sets the primitive identifier.
        Parameters:
        id - primitive identifier
      • setVersion

        public void setVersion​(int version)
        Sets the primitive version.
        Parameters:
        version - primitive version
      • makeCopy

        public abstract PrimitiveData makeCopy()
        Returns a copy of this primitive data.
        Returns:
        a copy of this primitive data
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • keysChangedImpl

        protected final void keysChangedImpl​(java.util.Map<java.lang.String,​java.lang.String> originalKeys)
        Description copied from class: AbstractPrimitive
        What to do, when the tags have changed by one of the tag-changing methods.
        Specified by:
        keysChangedImpl in class AbstractPrimitive
        Parameters:
        originalKeys - original tags
      • writeObject

        private void writeObject​(java.io.ObjectOutputStream oos)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        private void readObject​(java.io.ObjectInputStream ois)
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • isTagged

        public boolean isTagged()
        Description copied from interface: IPrimitive
        Determines if this object is considered "tagged". To be "tagged", an object must have one or more "interesting" tags. "created_by" and "source" are typically considered "uninteresting" and do not make an object "tagged".
        Specified by:
        isTagged in interface IPrimitive
        Overrides:
        isTagged in class AbstractPrimitive
        Returns:
        true if this object is considered "tagged"
      • isAnnotated

        public boolean isAnnotated()
        Description copied from interface: IPrimitive
        Determines if this object is considered "annotated". To be "annotated", an object must have one or more "work in progress" tags, such as "note" or "fixme".
        Specified by:
        isAnnotated in interface IPrimitive
        Overrides:
        isAnnotated in class AbstractPrimitive
        Returns:
        true if this object is considered "annotated"
      • setHighlighted

        public void setHighlighted​(boolean highlighted)
        Description copied from interface: IPrimitive
        Updates the highlight flag for this primitive.
        Specified by:
        setHighlighted in interface IPrimitive
        Parameters:
        highlighted - The new highlight flag.
      • getReferrers

        public final java.util.List<PrimitiveDatagetReferrers​(boolean allowWithoutDataset)
        Description copied from interface: IPrimitive
        Find primitives that reference this primitive. Returns only primitives that are included in the same dataset as this primitive.
        For example following code will add wnew as referer to all nodes of existingWay, but this method will not return wnew because it's not part of the dataset
        Way wnew = new Way(existingWay)
        Specified by:
        getReferrers in interface IPrimitive
        Parameters:
        allowWithoutDataset - If true, method will return empty list if primitive is not part of the dataset. If false, exception will be thrown in this case
        Returns:
        a collection of all primitives that reference this primitive.
      • getDataSet

        public OsmData<?,​?,​?,​?> getDataSet()
        Description copied from interface: IPrimitive
        Returns the parent data set of this primitive.
        Specified by:
        getDataSet in interface IPrimitive
        Returns:
        OsmData this primitive is part of.
      • isCachedStyleUpToDate

        public boolean isCachedStyleUpToDate()
        Description copied from interface: Stylable
        Check if the cached style for this primitive is up to date.
        Specified by:
        isCachedStyleUpToDate in interface Stylable
        Returns:
        true if the cached style for this primitive is up to date