Changeset 11332 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2016-11-28T01:49:49+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r11121 r11332 103 103 } 104 104 105 /** 106 * Visitor pattern. 107 * @param v visitor 108 */ 105 109 public void visit(Visitor v) { 106 110 v.visit(this); 107 111 } 108 112 113 /** 114 * Compares this changeset to another, based on their identifier. 115 * @param other other changeset 116 * @return the value {@code 0} if {@code getId() == other.getId()}; 117 * a value less than {@code 0} if {@code getId() < other.getId()}; and 118 * a value greater than {@code 0} if {@code getId() > other.getId()} 119 */ 109 120 public int compareTo(Changeset other) { 110 121 return Integer.compare(getId(), other.getId()); 111 122 } 112 123 124 /** 125 * Returns the changeset name. 126 * @return the changeset name (untranslated: "changeset <identifier>") 127 */ 113 128 public String getName() { 114 129 // no translation … … 116 131 } 117 132 133 /** 134 * Returns the changeset display name, as per given name formatter. 135 * @param formatter name formatter 136 * @return the changeset display name, as per given name formatter 137 */ 118 138 public String getDisplayName(NameFormatter formatter) { 119 139 return formatter.format(this); 120 140 } 121 141 142 /** 143 * Returns the changeset identifier. 144 * @return the changeset identifier 145 */ 122 146 public int getId() { 123 147 return id; 124 148 } 125 149 150 /** 151 * Sets the changeset identifier. 152 * @param id changeset identifier 153 */ 126 154 public void setId(int id) { 127 155 this.id = id; 128 156 } 129 157 158 /** 159 * Returns the changeset user. 160 * @return the changeset user 161 */ 130 162 public User getUser() { 131 163 return user; 132 164 } 133 165 166 /** 167 * Sets the changeset user. 168 * @param user changeset user 169 */ 134 170 public void setUser(User user) { 135 171 this.user = user; 136 172 } 137 173 174 /** 175 * Returns the changeset creation date. 176 * @return the changeset creation date 177 */ 138 178 public Date getCreatedAt() { 139 179 return createdAt; 140 180 } 141 181 182 /** 183 * Sets the changeset creation date. 184 * @param createdAt changeset creation date 185 */ 142 186 public void setCreatedAt(Date createdAt) { 143 187 this.createdAt = createdAt; 144 188 } 145 189 190 /** 191 * Returns the changeset closure date. 192 * @return the changeset closure date 193 */ 146 194 public Date getClosedAt() { 147 195 return closedAt; 148 196 } 149 197 198 /** 199 * Sets the changeset closure date. 200 * @param closedAt changeset closure date 201 */ 150 202 public void setClosedAt(Date closedAt) { 151 203 this.closedAt = closedAt; 152 204 } 153 205 206 /** 207 * Determines if this changeset is open. 208 * @return {@code true} if this changeset is open 209 */ 154 210 public boolean isOpen() { 155 211 return open; 156 212 } 157 213 214 /** 215 * Sets whether this changeset is open. 216 * @param open {@code true} if this changeset is open 217 */ 158 218 public void setOpen(boolean open) { 159 219 this.open = open; 160 220 } 161 221 222 /** 223 * Returns the min lat/lon of the changeset bounding box. 224 * @return the min lat/lon of the changeset bounding box 225 */ 162 226 public LatLon getMin() { 163 227 return min; 164 228 } 165 229 230 /** 231 * Sets the min lat/lon of the changeset bounding box. 232 * @param min min lat/lon of the changeset bounding box 233 */ 166 234 public void setMin(LatLon min) { 167 235 this.min = min; 168 236 } 169 237 238 /** 239 * Returns the max lat/lon of the changeset bounding box. 240 * @return the max lat/lon of the changeset bounding box 241 */ 170 242 public LatLon getMax() { 171 243 return max; 172 244 } 173 245 246 /** 247 * Sets the max lat/lon of the changeset bounding box. 248 * @param max min lat/lon of the changeset bounding box 249 */ 250 public void setMax(LatLon max) { 251 this.max = max; 252 } 253 254 /** 255 * Returns the changeset bounding box. 256 * @return the changeset bounding box 257 */ 174 258 public Bounds getBounds() { 175 259 if (min != null && max != null) 176 260 return new Bounds(min, max); 177 261 return null; 178 }179 180 public void setMax(LatLon max) {181 this.max = max;182 262 } 183 263 … … 217 297 } 218 298 299 /** 300 * Determines if this changeset is incomplete. 301 * @return {@code true} if this changeset is incomplete 302 */ 219 303 public boolean isIncomplete() { 220 304 return incomplete; 221 305 } 222 306 307 /** 308 * Sets whether this changeset is incomplete 309 * @param incomplete {@code true} if this changeset is incomplete 310 */ 223 311 public void setIncomplete(boolean incomplete) { 224 312 this.incomplete = incomplete; … … 249 337 } 250 338 339 /** 340 * Determines if this changeset has equals semantic attributes with another one. 341 * @param other other changeset 342 * @return {@code true} if this changeset has equals semantic attributes with other changeset 343 */ 251 344 public boolean hasEqualSemanticAttributes(Changeset other) { 252 345 if (other == null) … … 315 408 } 316 409 410 /** 411 * Determines if this changeset is new. 412 * @return {@code true} if this changeset is new ({@code id <= 0}) 413 */ 317 414 public boolean isNew() { 318 415 return id <= 0; 319 416 } 320 417 418 /** 419 * Merges changeset metadata from another changeset. 420 * @param other other changeset 421 */ 321 422 public void mergeFrom(Changeset other) { 322 423 if (other == null) … … 339 440 } 340 441 442 /** 443 * Determines if this changeset has contents. 444 * @return {@code true} if this changeset has contents 445 */ 341 446 public boolean hasContent() { 342 447 return content != null; 343 448 } 344 449 450 /** 451 * Returns the changeset contents. 452 * @return the changeset contents, can be null 453 */ 345 454 public ChangesetDataSet getContent() { 346 455 return content; 347 456 } 348 457 458 /** 459 * Sets the changeset contents. 460 * @param content changeset contents, can be null 461 */ 349 462 public void setContent(ChangesetDataSet content) { 350 463 this.content = content;
Note:
See TracChangeset
for help on using the changeset viewer.