Changeset 13907 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-06-10T21:05:01+02:00 (6 years ago)
Author:
Don-vip
Message:

add IWay.setNodes()

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

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

    r13766 r13907  
    6868
    6969    /**
     70     * Set new list of nodes to way. This method is preferred to multiple calls to addNode/removeNode
     71     * and similar methods because nodes are internally saved as array which means lower memory overhead
     72     * but also slower modifying operations.
     73     * @param nodes New way nodes. Can be null, in that case all way nodes are removed
     74     */
     75    void setNodes(List<N> nodes);
     76
     77    /**
    7078     * Determines if this way is closed.
    7179     * @return {@code true} if this way is closed, {@code false} otherwise
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r13816 r13907  
    4040    }
    4141
    42     /**
    43      * Set new list of nodes to way. This method is preferred to multiple calls to addNode/removeNode
    44      * and similar methods because nodes are internally saved as array which means lower memory overhead
    45      * but also slower modifying operations.
    46      * @param nodes New way nodes. Can be null, in that case all way nodes are removed
    47      * @since 1862
    48      */
     42    @Override
    4943    public void setNodes(List<Node> nodes) {
    5044        checkDatasetNotReadOnly();
  • trunk/src/org/openstreetmap/josm/data/osm/WayData.java

    r13764 r13907  
    7171    }
    7272
     73    @Override
     74    public void setNodes(List<NodeData> nodes) {
     75        throw new UnsupportedOperationException("Use setNodeIds(List) instead");
     76    }
     77
    7378    /**
    7479     * Sets the nodes array
    7580     * @param nodes The nodes this way consists of
     81     * @since 13907
    7682     */
    77     public void setNodes(List<Long> nodes) {
     83    public void setNodeIds(List<Long> nodes) {
    7884        this.nodes = new ArrayList<>(nodes);
    7985    }
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java

    r11878 r13907  
    153153    public WayData fillPrimitiveData(WayData data) {
    154154        super.fillPrimitiveCommonData(data);
    155         data.setNodes(nodeIds);
     155        data.setNodeIds(nodeIds);
    156156        return data;
    157157    }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java

    r12809 r13907  
    8282            newNodes.add(mappedPrimitives.get(n).getUniqueId());
    8383        }
    84         clone.setNodes(newNodes);
     84        clone.setNodeIds(newNodes);
    8585        mappedPrimitives.put(w, clone);
    8686    }
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveDataPaster.java

    r13717 r13907  
    132132            }
    133133        }
    134         ((WayData) data).setNodes(newNodes);
     134        ((WayData) data).setNodeIds(newNodes);
    135135    }
    136136
Note: See TracChangeset for help on using the changeset viewer.