Changeset 2077 in josm for trunk/src/org/openstreetmap/josm/data/osm/Way.java
- Timestamp:
- 2009-09-07T23:06:19+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2070 r2077 3 3 4 4 import java.util.ArrayList; 5 5 6 import java.util.Arrays; 6 7 import java.util.Collection; … … 10 11 import org.openstreetmap.josm.tools.CopyList; 11 12 import org.openstreetmap.josm.tools.Pair; 13 import static org.openstreetmap.josm.tools.I18n.tr; 12 14 13 15 /** … … 123 125 */ 124 126 public Way(){ 127 super(0); 125 128 } 126 129 … … 197 200 } 198 201 199 public void addNode(Node n) { 202 /** 203 * Adds a node to the end of the list of nodes. Ignored, if n is null. 204 * 205 * @param n the node. Ignored, if null. 206 * @throws IllegalStateException thrown, if this way is marked as incomplete. We can't add a node 207 * to an incomplete way 208 */ 209 public void addNode(Node n) throws IllegalStateException { 210 if (n==null) return; 211 if (incomplete) 212 throw new IllegalStateException(tr("can't add node {0} to incomplete way {1}", n.getId(), getId())); 200 213 if (incomplete) return; 201 214 clearCached(); … … 203 216 } 204 217 205 public void addNode(int offs, Node n) { 206 if (incomplete) return; 218 /** 219 * Adds a node at position offs. 220 * 221 * @param int offs the offset 222 * @param n the node. Ignored, if null. 223 * @throws IllegalStateException thrown, if this way is marked as incomplete. We can't add a node 224 * to an incomplete way 225 * @throws IndexOutOfBoundsException thrown if offs is out of bounds 226 */ 227 public void addNode(int offs, Node n) throws IllegalStateException, IndexOutOfBoundsException { 228 if (n==null) return; 229 if (incomplete) 230 throw new IllegalStateException(tr("can't add node {0} to incomplete way {1}", n.getId(), getId())); 207 231 clearCached(); 208 232 nodes.add(offs, n);
Note:
See TracChangeset
for help on using the changeset viewer.