Changeset 2578 in josm for trunk/src/org/openstreetmap/josm/data/osm/Way.java
- Timestamp:
- 2009-12-05T18:23:03+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2555 r2578 116 116 public ArrayList<Pair<Node,Node>> getNodePairs(boolean sort) { 117 117 ArrayList<Pair<Node,Node>> chunkSet = new ArrayList<Pair<Node,Node>>(); 118 if (i ncomplete) return chunkSet;118 if (isIncomplete()) return chunkSet; 119 119 Node lastN = null; 120 120 for (Node n : this.nodes) { … … 219 219 220 220 @Override public String toString() { 221 String nodesDesc = i ncomplete?"(incomplete)":"nodes=" + Arrays.toString(nodes);221 String nodesDesc = isIncomplete()?"(incomplete)":"nodes=" + Arrays.toString(nodes); 222 222 return "{Way id=" + getUniqueId() + " version=" + getVersion()+ " " + getFlagsAsString() + " " + nodesDesc + "}"; 223 223 } … … 245 245 246 246 public void removeNode(Node n) { 247 if (i ncomplete) return;247 if (isIncomplete()) return; 248 248 boolean closed = (lastNode() == n && firstNode() == n); 249 249 int i; … … 262 262 263 263 public void removeNodes(Collection<? extends OsmPrimitive> selection) { 264 if (i ncomplete) return;264 if (isIncomplete()) return; 265 265 for(OsmPrimitive p : selection) { 266 266 if (p instanceof Node) { … … 279 279 public void addNode(Node n) throws IllegalStateException { 280 280 if (n==null) return; 281 if (i ncomplete)281 if (isIncomplete()) 282 282 throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId())); 283 283 clearCached(); … … 301 301 public void addNode(int offs, Node n) throws IllegalStateException, IndexOutOfBoundsException { 302 302 if (n==null) return; 303 if (i ncomplete)303 if (isIncomplete()) 304 304 throw new IllegalStateException(tr("Cannot add node {0} to incomplete way {1}.", n.getId(), getId())); 305 305 clearCached(); … … 327 327 328 328 public boolean isClosed() { 329 if (i ncomplete) return false;329 if (isIncomplete()) return false; 330 330 return nodes.length >= 3 && lastNode() == firstNode(); 331 331 } 332 332 333 333 public Node lastNode() { 334 if (i ncomplete|| nodes.length == 0) return null;334 if (isIncomplete() || nodes.length == 0) return null; 335 335 return nodes[nodes.length-1]; 336 336 } 337 337 338 338 public Node firstNode() { 339 if (i ncomplete|| nodes.length == 0) return null;339 if (isIncomplete() || nodes.length == 0) return null; 340 340 return nodes[0]; 341 341 } 342 342 343 343 public boolean isFirstLastNode(Node n) { 344 if (i ncomplete|| nodes.length == 0) return false;344 if (isIncomplete() || nodes.length == 0) return false; 345 345 return n == firstNode() || n == lastNode(); 346 346 }
Note:
See TracChangeset
for help on using the changeset viewer.