Changeset 13808 in josm


Ignore:
Timestamp:
2018-05-21T19:53:31+02:00 (18 months ago)
Author:
Don-vip
Message:

add IPrimitive.getReferrers(boolean allowWithoutDataset)

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java

    r13807 r13808  
    416416     * @since 13764
    417417     */
    418     List<? extends IPrimitive> getReferrers();
     418    default List<? extends IPrimitive> getReferrers() {
     419        return getReferrers(false);
     420    }
     421
     422    /**
     423     * Find primitives that reference this primitive. Returns only primitives that are included in the same
     424     * dataset as this primitive. <br>
     425     *
     426     * For example following code will add wnew as referer to all nodes of existingWay, but this method will
     427     * not return wnew because it's not part of the dataset <br>
     428     *
     429     * <code>Way wnew = new Way(existingWay)</code>
     430     *
     431     * @param allowWithoutDataset If true, method will return empty list if primitive is not part of the dataset. If false,
     432     * exception will be thrown in this case
     433     *
     434     * @return a collection of all primitives that reference this primitive.
     435     * @since 13808
     436     */
     437    List<? extends IPrimitive> getReferrers(boolean allowWithoutDataset);
    419438
    420439    /**
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r13807 r13808  
    944944    }
    945945
    946     /**
    947      * Find primitives that reference this primitive. Returns only primitives that are included in the same
    948      * dataset as this primitive. <br>
    949      *
    950      * For example following code will add wnew as referer to all nodes of existingWay, but this method will
    951      * not return wnew because it's not part of the dataset <br>
    952      *
    953      * <code>Way wnew = new Way(existingWay)</code>
    954      *
    955      * @param allowWithoutDataset If true, method will return empty list if primitive is not part of the dataset. If false,
    956      * exception will be thrown in this case
    957      *
    958      * @return a collection of all primitives that reference this primitive.
    959      */
     946    @Override
    960947    public final List<OsmPrimitive> getReferrers(boolean allowWithoutDataset) {
    961948        // Returns only referrers that are members of the same dataset (primitive can have some fake references, for example
  • trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java

    r13807 r13808  
    166166
    167167    @Override
    168     public final List<PrimitiveData> getReferrers() {
     168    public final List<PrimitiveData> getReferrers(boolean allowWithoutDataset) {
    169169        return Collections.emptyList();
    170170    }
Note: See TracChangeset for help on using the changeset viewer.