Changeset 19232 in osm for applications/viewer/jmapviewer/src/org/openstreetmap
- Timestamp:
- 2009-12-28T13:31:52+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
r18772 r19232 180 180 return loading; 181 181 } 182 182 183 public void setLoaded(boolean loaded) { 183 184 this.loaded = loaded; … … 209 210 } 210 211 212 /** 213 * Note that the hash code does not include the {@link #source}. 214 * Therefore a hash based collection can only contain tiles 215 * of one {@link #source}. 216 */ 217 @Override 218 public int hashCode() { 219 final int prime = 31; 220 int result = 1; 221 result = prime * result + xtile; 222 result = prime * result + ytile; 223 result = prime * result + zoom; 224 return result; 225 } 226 227 /** 228 * Compares this object with <code>obj</code> based on 229 * the fields {@link #xtile}, {@link #ytile} and 230 * {@link #zoom}. 231 * The {@link #source} field is ignored. 232 */ 211 233 @Override 212 234 public boolean equals(Object obj) { 213 if (!(obj instanceof Tile)) 214 return false; 215 Tile tile = (Tile) obj; 216 return (xtile == tile.xtile) && (ytile == tile.ytile) && (zoom == tile.zoom); 235 if (this == obj) 236 return true; 237 if (obj == null) 238 return false; 239 if (getClass() != obj.getClass()) 240 return false; 241 Tile other = (Tile) obj; 242 if (xtile != other.xtile) 243 return false; 244 if (ytile != other.ytile) 245 return false; 246 if (zoom != other.zoom) 247 return false; 248 return true; 217 249 } 218 250 … … 220 252 return zoom + "/" + xtile + "/" + ytile + "@" + source.getName(); 221 253 } 254 222 255 public String getStatus() { 223 256 String status = "new"; … … 230 263 return status; 231 264 } 265 232 266 public boolean hasError() { 233 267 return error;
Note:
See TracChangeset
for help on using the changeset viewer.