Ignore:
Timestamp:
2018-06-11T20:38:24+02:00 (18 months ago)
Author:
Don-vip
Message:

add first/last node methods to IWay

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

Legend:

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

    r13907 r13918  
    9292        return formatter.format(this);
    9393    }
     94
     95    /**
     96     * Returns the first node of this way.
     97     * The result equals {@link #getNode getNode}{@code (0)}.
     98     * @return the first node of this way
     99     * @since 13918
     100     */
     101    Node firstNode();
     102
     103    /**
     104     * Returns the last node of this way.
     105     * The result equals <code>{@link #getNode getNode}({@link #getNodesCount getNodesCount} - 1)</code>.
     106     * @return the last node of this way
     107     * @since 13918
     108     */
     109    Node lastNode();
     110
     111    /**
     112     * Replies true if the given node is the first or the last one of this way, false otherwise.
     113     * @param n The node to test
     114     * @return true if the {@code n} is the first or the last node, false otherwise.
     115     * @since 13918
     116     */
     117    boolean isFirstLastNode(Node n);
     118
     119    /**
     120     * Replies true if the given node is an inner node of this way, false otherwise.
     121     * @param n The node to test
     122     * @return true if the {@code n} is an inner node, false otherwise.
     123     * @since 13918
     124     */
     125    boolean isInnerNode(Node n);
    94126}
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r13907 r13918  
    490490    }
    491491
    492     /**
    493      * Returns the last node of this way.
    494      * The result equals <code>{@link #getNode getNode}({@link #getNodesCount getNodesCount} - 1)</code>.
    495      * @return the last node of this way
    496      * @since 1400
    497      */
     492    @Override
    498493    public Node lastNode() {
    499494        Node[] nodes = this.nodes;
     
    502497    }
    503498
    504     /**
    505      * Returns the first node of this way.
    506      * The result equals {@link #getNode getNode}{@code (0)}.
    507      * @return the first node of this way
    508      * @since 1400
    509      */
     499    @Override
    510500    public Node firstNode() {
    511501        Node[] nodes = this.nodes;
     
    514504    }
    515505
    516     /**
    517      * Replies true if the given node is the first or the last one of this way, false otherwise.
    518      * @param n The node to test
    519      * @return true if the {@code n} is the first or the last node, false otherwise.
    520      * @since 1400
    521      */
     506    @Override
    522507    public boolean isFirstLastNode(Node n) {
    523508        Node[] nodes = this.nodes;
     
    526511    }
    527512
    528     /**
    529      * Replies true if the given node is an inner node of this way, false otherwise.
    530      * @param n The node to test
    531      * @return true if the {@code n} is an inner node, false otherwise.
    532      * @since 3515
    533      */
     513    @Override
    534514    public boolean isInnerNode(Node n) {
    535515        Node[] nodes = this.nodes;
  • trunk/src/org/openstreetmap/josm/data/osm/WayData.java

    r13907 r13918  
    88
    99/**
    10  * The data (tags and node ids) that is stored for a way in the database
     10 * The data (tags and node ids) that is stored for a way in the database.
     11 * @since 2284
    1112 */
    1213public class WayData extends PrimitiveData implements IWay<NodeData> {
     
    109110        throw new UnsupportedOperationException();
    110111    }
     112
     113    @Override
     114    public Node firstNode() {
     115        throw new UnsupportedOperationException();
     116    }
     117
     118    @Override
     119    public Node lastNode() {
     120        throw new UnsupportedOperationException();
     121    }
     122
     123    @Override
     124    public boolean isFirstLastNode(Node n) {
     125        throw new UnsupportedOperationException();
     126    }
     127
     128    @Override
     129    public boolean isInnerNode(Node n) {
     130        throw new UnsupportedOperationException();
     131    }
    111132}
Note: See TracChangeset for help on using the changeset viewer.