Class VectorPrimitive

    • Constructor Detail

      • VectorPrimitive

        protected VectorPrimitive​(String layer)
        Create a primitive for a specific vector layer
        Parameters:
        layer - The layer for the primitive
    • Method Detail

      • isHighlighted

        public boolean isHighlighted()
        Description copied from interface: IPrimitive
        Checks if the highlight flag for this primitive was set
        Specified by:
        isHighlighted in interface IPrimitive
        Returns:
        The highlight flag.
      • 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.
      • 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
        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
        Returns:
        true if this object is considered "annotated"
      • isCachedStyleUpToDate

        public final 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
      • hasDirectionKeys

        public boolean hasDirectionKeys()
        Description copied from interface: IPrimitive
        true if this object has direction dependent tags (e.g. oneway)
        Specified by:
        hasDirectionKeys in interface IPrimitive
        Returns:
        true if this object has direction dependent tags
      • reversedDirection

        public boolean reversedDirection()
        Description copied from interface: IPrimitive
        true if this object has the "reversed direction" flag enabled
        Specified by:
        reversedDirection in interface IPrimitive
        Returns:
        true if this object has the "reversed direction" flag enabled
      • getReferrers

        public final List<VectorPrimitivegetReferrers​(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.
      • addReferrer

        protected void addReferrer​(IPrimitive referrer)
        Add new referrer. If referrer is already included then no action is taken
        Parameters:
        referrer - The referrer to add
      • removeReferrer

        protected void removeReferrer​(IPrimitive referrer)
        Remove referrer. No action is taken if referrer is not registered
        Parameters:
        referrer - The referrer to remove
      • referrers

        public final <T extends IPrimitiveStream<T> referrers​(Class<T> filter)
        Gets all primitives in the current dataset that reference this primitive.
        Type Parameters:
        T - type of primitives
        Parameters:
        filter - restrict primitives to subclasses
        Returns:
        the referrers as Stream
      • setId

        protected void setId​(long id)
        Set the id of the object
        Parameters:
        id - The id
      • setDisabled

        public void setDisabled​(boolean disabled)
        Make this object disabled
        Parameters:
        disabled - true to disable the object
      • isDrawable

        public boolean isDrawable()
        Description copied from interface: IPrimitive
        Determines if this object is drawable.

        A primitive is drawable if all conditions are met:

        • type and id is known
        • tags are known
        • it is not deleted
        • it is not hidden by a filter
        • for nodes: lat/lon are known
        • for ways: all nodes are known and complete
        • for relations: all members are known and complete
        Specified by:
        isDrawable in interface IPrimitive
        Returns:
        true if this object is drawable