Changeset 2070 in josm for trunk/src/org/openstreetmap/josm/data/osm/Way.java
- Timestamp:
- 2009-09-06T23:07:33+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r2017 r2070 119 119 120 120 /** 121 * Creates a new way with id 0. 122 * 123 */ 124 public Way(){ 125 } 126 127 /** 121 128 * Create an identical clone of the argument (including the id). 122 129 * … … 124 131 */ 125 132 public Way(Way original) { 133 super(original.getId()); 126 134 cloneFrom(original); 127 135 } 128 136 129 137 /** 130 * Create an empty way without id. Use this only if you set meaningful 131 * values yourself. 132 */ 133 public Way() { 134 } 135 136 /** 137 * Create an incomplete Way with a given id. 138 * 139 * @param id the id. id > 0 required. 140 */ 141 public Way(long id) { 142 // FIXME: shouldn't we check for id > 0? 143 // 144 this.id = id; 145 incomplete = true; 138 * Creates a new way for the given id. If the id > 0, the way is marked 139 * as incomplete. 140 * 141 * @param id the id. > 0 required 142 * @throws IllegalArgumentException thrown if id < 0 143 */ 144 public Way(long id) throws IllegalArgumentException { 145 super(id); 146 146 } 147 147 … … 153 153 154 154 @Override public String toString() { 155 if (incomplete) return "{Way id="+ id+" version="+version+" (incomplete)}";156 return "{Way id="+ id+" version="+version+" nodes="+Arrays.toString(nodes.toArray())+"}";155 if (incomplete) return "{Way id="+getId()+" version="+getVersion()+" (incomplete)}"; 156 return "{Way id="+getId()+" version="+getVersion()+" nodes="+Arrays.toString(nodes.toArray())+"}"; 157 157 } 158 158 … … 170 170 if (o instanceof Relation) 171 171 return 1; 172 return o instanceof Way ? Long.valueOf( id).compareTo(o.id) : -1;172 return o instanceof Way ? Long.valueOf(getId()).compareTo(o.getId()) : -1; 173 173 } 174 174
Note:
See TracChangeset
for help on using the changeset viewer.