Ignore:
Timestamp:
2018-05-08T14:41:28+02:00 (6 years ago)
Author:
Don-vip
Message:

better API alignment between Way and WayData

File:
1 edited

Legend:

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

    r12193 r13717  
    1010 * The data (tags and node ids) that is stored for a way in the database
    1111 */
    12 public class WayData extends PrimitiveData implements IWay {
     12public class WayData extends PrimitiveData implements IWay<NodeData> {
    1313
    1414    private static final long serialVersionUID = 106944939313286415L;
     
    3737    public WayData(WayData data) {
    3838        super(data);
    39         nodes.addAll(data.getNodes());
     39        nodes.addAll(data.getNodeIds());
    4040    }
    4141
    42     /**
    43      * Gets a list of nodes the way consists of
    44      * @return The ids of the nodes
    45      */
    46     public List<Long> getNodes() {
     42    @Override
     43    public List<NodeData> getNodes() {
     44        throw new UnsupportedOperationException("Use getNodeIds() instead");
     45    }
     46
     47    @Override
     48    public NodeData getNode(int index) {
     49        throw new UnsupportedOperationException("Use getNodeId(int) instead");
     50    }
     51
     52    @Override
     53    public List<Long> getNodeIds() {
    4754        return nodes;
    4855    }
Note: See TracChangeset for help on using the changeset viewer.